Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

0% code coverage using Clover!

 
krithika desai
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
I integrated clover into the build.
Enabled instrumentation of the source files while compiling and that went through.
When i run the unit tests, i see 0% code coverage in the clover reports.
While compiling I instrumented the test classes as well. ( I shall switch it off).
But i found that it is reporting the test code that got covered! instead of the code that the tests actually access:
ant runalltests clover.report
runalltests runs all the unit tests while clove.report generated the report.
What am i doing wrong here?
thanks.
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by krithika desai:
All,
I integrated clover into the build.
Enabled instrumentation of the source files while compiling and that went through.
When i run the unit tests, i see 0% code coverage in the clover reports.
While compiling I instrumented the test classes as well. ( I shall switch it off).
But i found that it is reporting the test code that got covered! instead of the code that the tests actually access:

ant runalltests clover.report

runalltests runs all the unit tests while clove.report generated the report.

What am i doing wrong here?
thanks.


I know this is an ancient post, but I've been experiencing the same issues with Clover. The first thing I discovered is that the coverage data doesn't get written until the JVM running the tests complete. This means that you need to either fork the tests or run the report as a seperate Ant job. In some circumstances, which I haven't resolved yet, forking the JUnit tests doesn't fix the problem, but running the report seperately always does.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic