Reputation: 25116
(There are a tonne of these questions, but all the ones I can find relate to Maven. Before you suggest this one is a duplicate, please understand that this doesn't relate to Maven in any way.)
I am using Cobertura within Eclipse to determine my percentage of code covered by my JUnit tests. All 99 of my unit tests run successfully, both within and outside of Cobertura, but Cobertura reports back that they have covered 0% of my code.
I :
Why does Cobertura report 0%?
Upvotes: 4
Views: 4144
Reputation: 1473
I found that this was a problem for me because I was compiling my source files without line numbers. If this is your problem, you will see
[cobertura-instrument] WARN visitEnd, No line number information found for class com.x.y.z.A.
Perhaps you need to compile with debug=true?
To solve this, add debug="true" debuglevel="vars,lines,source"
to your javac
command.
See also:
http://meera-subbarao.blogspot.co.uk/2008/07/cobertura-instrument-warn-visitend-no.html
How to remove specific Cobertura warning?
Upvotes: 1