给定以下测试套件:
class ParallelizeMe extends FunSuite with BeforeAndAfterAll {
override def beforeAll() = println("before")
override def afterAll() = println("after")
test("test 1") {
println("1a")
Thread.sleep(3000)
println("1b")
}
test("test 2") {
println("2a")
Thread.sleep(1000)
println("2b")
}
}
如何并行运行测试(通过 sbt)?理想情况下,我希望执行顺序在标准输出上产生以下内容:
before
1a
2a
2b
1b
after