I'm trying to measure a code coverage on some project. It has its own build infrastructure and doesn't use maven/ant. When I run unit tests I pass all required arguments: "-javaagent:~/jacoco/lib/jacocoagent.jar=destfile=/tmp/jacoco_test/coverage.exec". Everything looks fine and runs without any errors. But when I convert coverage.exec to html report it shows 0% coverage. What's is the most curious thing, when I run "java -jar ~/tmp/java_coverage/jacoco/lib/jacococli.jar execinfo /tmp/jacoco_test/coverage.exec", I see there only test-related classes, while I expected to see test-covered (classes implementing business logic itself or classes under tests) classes as well. I understand that my guess might be wrong. So could you please clarify that I should see test-covered classes in the execinfo output as well? I'm absolutely puzzled, any help appreciated.
Great thank you in advance!
Hello Jacococers,I'm trying to measure a code coverage on some project. It has its own build infrastructure and doesn't use maven/ant. When I run unit tests I pass all required arguments: "-javaagent:~/jacoco/lib/jacocoagent.jar=destfile=/tmp/jacoco_test/coverage.exec". Everything looks fine and runs without any errors. But when I convert coverage.exec to html report it shows 0% coverage. What's is the most curious thing, when I run "java -jar ~/tmp/java_coverage/jacoco/lib/jacococli.jar execinfo /tmp/jacoco_test/coverage.exec", I see there only test-related classes, while I expected to see test-covered (classes implementing business logic itself or classes under tests) classes as well. I understand that my guess might be wrong. So could you please clarify that I should see test-covered classes in the execinfo output as well?


First to be sure let's clarify how your tests exercise classes under tests - are classes under tests in the same JVM as tests? if you put a breakpoint into class under test and execute test in debug, will the breakpoint be reached?