7

How do I configure sbt 0.10 to use the junitxml option with specs2?

The specs2 documentation says this is the way to do it using sbt 0.7.x:

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

How do I say the same thing in sbt 0.10?

Eric
  • 15,494
  • 38
  • 61
Adam Pingel
  • 681
  • 4
  • 19

2 Answers2

11

FYI, I found that when running Specs2 tests with juntxml SBT fails to fail when the tests fail. Adding "console" as another argument gets a build failure like you'd expect. I suspect this is some interaction between the console reporter and sbt's test driver.

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

user1633296
  • 111
  • 1
  • 2
7

This is described here in the SBT documentation:

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

And if you want to specify this option specifically for specs2:

testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "junitxml")
Eric
  • 15,494
  • 38
  • 61