Hi,
I was finally able to debug this issue.
The problem seems to be this line:
https://github.com/hcoles/pitest/blob/master/pitest/src/main/java/org/pitest/junit/JUnitCustomRunnerTestUnitFinder.java#L62because if the test has classnotfound error or some other error very early on, this condition is triggered, and test analysis is aborted silently. This will cause low code coderage without any explanations.
When I commented that line out, I get the error message properly:
22:00:59 PIT >> INFO : SLAVE : 22:00:59 PIT >> WARNING : JUnit error for class class com.tonicsystem
s.jarjar.DepFindTest : com.tonicsystems.jarjar.DepFindTest
22:00:59 PIT >> FINE : SLAVE : ERROR Description [testClass=com.tonicsystems.jarjar.DepFindTest, nam
e=com.tonicsystems.jarjar.DepFindTest] -> java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribin
g
22:00:59 PIT >> INFO : SLAVE : java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
..
22:00:59 PIT >> INFO : Calculated coverage in 0 seconds.
Exception in thread "main" org.pitest.help.PitHelpError: All tests did not pass without mutation whe
n calculating line coverage. Mutation testing requires a green suite.
See
http://pitest.org for more details.
The test case is at
https://github.com/eis/pitest-hamcrest-issue-demoI'll update the details I've found to the issue I opened for this:
https://github.com/hcoles/pitest/issues/105and will prepare a pull request on removing that line so it won't cause silent errors anymore if that is the way to fix it.
However, is that the correct course of action? Is there some reason for that line?
-Jarkko