16
votes

Is there a way to have SBT re-run only the tests that have failed in the last run of the test suite? For example, if I run sbt test and 3 out of the 20 tests I run fail, is there any command I can run to have SBT just re-run those 3 tests that fail?

Specifically I am using Scala Test and Scala Check for the tests I am running through SBT.

1
That seems to work for the ScalaCheck tests, but not for the Scala Test tests.Christopher Wells
Actually, I tried it again and noticed that it rather just ignores all of the ScalaCheck test event the ones the fail.Christopher Wells

1 Answers

15
votes

If you are using the latest version of sbt simply run sbt testQuick.

http://www.scala-sbt.org/0.13/docs/Testing.html