Page 1 of 1

Automated tests via bash/make?

Posted: 2009-05-04 4:50 pm
by Ivor
From a makefile I'm able to start up jscoverage-server, run the tests, and log the results into the directory jscoverage-report. It all works flawlessly. (Thank you very much.)

However I'd like to check the results from within the makefile too. I don't want to manually have to point the browser at the jscoverage.html file and eyeball it. So I greped the jscoverage-report directory looking for the percentage of code covered shown to me in the jscovearge.html file. I also greped for the line count and lines covered. Couldn't get grep to sink it's teeth in anything though...

If I could simply get the number of lines and number of lines checked for each .js file via grep or perhaps some CLI command specific to jscoverage I'd be able to proceed to the next problem. Do you have any recommendations?


Re: Automated tests via bash/make?

Posted: 2009-05-04 5:42 pm
by Ed
There is no functionality built in to the jscoverage command-line program to display coverage data; you would need to write a tool to process the coverage data stored in the file jscoverage.json in the coverage report directory. (The jscoverage.json file does not contain summary information, only raw data - i.e., the number of times each line of code was executed. You would need to loop through this to count all the lines.)

Re: Automated tests via bash/make?

Posted: 2009-05-04 9:44 pm
by Ivor
Ok, I didn't know anything about json when I read your comment but it wasn't difficult to read up on it and get a little utility going. I'll integrate it in over the next few days.