【问题标题】:Exception in thread "main" org.pitest.help.PitHelpError, while trying to run Android Application with Activity as Pit Mutation Testing线程“主”org.pitest.help.PitHelpError 中的异常,同时尝试使用 Activity 作为 Pit 变异测试运行 Android 应用程序
【发布时间】:2016-03-16 04:39:54
【问题描述】:

我在 Eclipse 中创建了一个 Android 项目,并成功获得了包含线路和突变覆盖率的 Pit Mutation 覆盖率报告,同时我删除了“Extend Activity”和“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)

【问题讨论】:

    标签: android pitest


    【解决方案1】:

    发生这种情况是因为您的一项测试在被 PITest 变异后失败。 如果您向上滚动日志,您将看到测试是什么,例如:

    2:30:13 PM PIT >> WARNING : Description [testClass=com.foo.BarTest, name=foo(com.foo.BarTest)] did not pass without mutation.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-05
      • 1970-01-01
      • 1970-01-01
      • 2015-11-24
      • 2020-09-23
      • 2020-04-10
      • 2015-07-13
      相关资源
      最近更新 更多