问题
I have created one Android project in Eclipse, and I got successfully Pit Mutation coverage report with line and mutation coverage, while I have removed "Extend Activity" and "onCreate()". but if I'm trying to get coverage with Android Activity and its life cycle Pit Mutation Test giving me error.
Exception in thread "main" org.pitest.help.PitHelpError: All tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite.See http://pitest.org for more details.
at org.pitest.coverage.execute.DefaultCoverageGenerator.verifyBuildSuitableForMutationTesting(DefaultCoverageGenerator.java:108)
at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:93)
at org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:49)
at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:112)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:101)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:43)
at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:72)
at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:43)
at org.pitest.pitclipse.pitrunner.PitRunner.runPIT(PitRunner.java:49)
at org.pitest.pitclipse.pitrunner.PitRunner.main(PitRunner.java:28)
回答1:
This happens because one of your tests failed after been mutated by PITest. IF you scroll the logs up, you will see what test is, e.g.:
2:30:13 PM PIT >> WARNING : Description [testClass=com.foo.BarTest, name=foo(com.foo.BarTest)] did not pass without mutation.
来源:https://stackoverflow.com/questions/36026911/exception-in-thread-main-org-pitest-help-pithelperror-while-trying-to-run-and