Automated tests via bash/make?

Questions, problems, suggestions, bug reports, and so on.
Post Reply
Ivor
Posts: 2
Joined: 2009-05-04 4:20 pm

Automated tests via bash/make?

Post by Ivor » 2009-05-04 4:50 pm

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?

thanks.

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Automated tests via bash/make?

Post by Ed » 2009-05-04 5:42 pm

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.)

Ivor
Posts: 2
Joined: 2009-05-04 4:20 pm

Re: Automated tests via bash/make?

Post by Ivor » 2009-05-04 9:44 pm

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.

Post Reply