我在Eclipse中创建了一个Android项目,并且我成功获得了具有线和变异覆盖率的Pit Mutation覆盖率报告,而我已经删除了" 扩展活动"和" onCreate()"。但如果我试图通过Android Activity及其生命周期进行覆盖,那么Pit Mutation Test会给我错误。
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)
答案 0 :(得分:0)
这是因为您的一个测试在被PITest变异后失败了。 如果您向上滚动日志,您将看到测试是什么,例如:
2:30:13 PM PIT >> WARNING : Description [testClass=com.foo.BarTest, name=foo(com.foo.BarTest)] did not pass without mutation.