How to disable a test suite, i.e. all tests inside class extending FunSpec
?
The only solution I'd found is to replace it
with ignore
in front of each test, but it is boring to do so with the dozens of tests.
It has been inserted into Scaladoc by pretending it is a trait. When you mark a test class with a tag annotation, ScalaTest will mark each test defined in that class with that tag. Thus, marking the SetSpec in the above example with the @Ignore tag annotation means that both tests in the class will be ignored.
The docs for Google Test 1.7 suggest: If you have a broken test that you cannot fix right away, you can add the DISABLED_ prefix to its name. This will exclude it from execution. This is better than commenting out the code or using #if 0 , as disabled tests are still compiled (and thus won't rot).
The easy way to do this in 1.8 is to add a constructor that takes a dummy argument. ScalaTest (and sbt) won't discover the class if it doesn't have a public, no-arg constructor:
class MySuite(ignore: String) extends FunSuite { // ... }
In 2.0 you'll be able to just write @Ignore on the class:
@Ignore class MySuite extends FunSuite { // ... }
You can use @Ignore both for distinct tests and the whole suit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With