【问题标题】:Configuring junitxml output for specs2 tests in sbt 0.10在 sbt 0.10 中为 specs2 测试配置 junitxml 输出
【发布时间】:2012-12-01 08:37:27
【问题描述】:

如何配置 sbt 0.10 以使用带有 specs2 的 junitxml 选项?

specs2 documentation 说这是使用 sbt 0.7.x 的方法:

override def testOptions = super.testOptions ++ Seq(TestArgument("junitxml"))

我如何在 sbt 0.10 中说同样的话?

【问题讨论】:

    标签: scala sbt specs2


    【解决方案1】:

    仅供参考,我发现当使用 juntxml 运行 Specs2 测试时,SBT 会在测试失败时失败。添加“控制台”作为另一个参数会导致构建失败,如您所料。我怀疑这是控制台报告器和 sbt 的测试驱动程序之间的一些交互。

    Test 中的 testOptions += Tests.Argument(TestFrameworks.Specs2, "junitxml", "console")

    【讨论】:

      【解决方案2】:

      这在 SBT 文档中描述为 here

      testOptions in Test += Tests.Argument("junitxml")
      

      如果您想专门为 specs2 指定此选项:

      testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "junitxml")
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-07-27
        • 2016-02-29
        • 1970-01-01
        • 1970-01-01
        • 2011-02-12
        • 1970-01-01
        • 2013-03-02
        • 2013-03-02
        相关资源
        最近更新 更多