In 2.0.4, I can use SBT Tests.Setup instances to run things before tests start running. E.g. adding a setting to a new 2.0.4 project as follows will print "foo" before the tests are run:
object ApplicationBuild extends Build {
…
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
testOptions in Test += Tests.Setup(() => println("foo"))
)
}
In 2.1.0, I've tried the following (which I thought should be equivalent), but nothing is printed:
object ApplicationBuild extends Build {
…
val main = play.Project(appName, appVersion, appDependencies).settings(
testOptions in Test += Tests.Setup(() => println("foo"))
)
}
The option is being loaded by SBT:
[two-one] $ show test:test-options
[info] List(Argument(Some(TestFramework(org.specs2.runner.SpecsFramework)),List(sequential, true)), Argument(Some(TestFramework(com.novocode.junit.JUnitFramework)),List(junitxml, console)), Setup(<function1>))
[success] Total time: 0 s, completed Feb 28, 2013 5:25:33 PM
[two-one] $
A standalone SBT config using SBT 0.12.2 and Scala 2.10.0 works fine. Any ideas what I'm doing wrong here?