An area can be either a project, or a configuration, or a task. In this case, I think you want to define a user configuration.
using itSettings
Now there is a built-in configuration called IntegrationTest . You can define it in the assembly definition by writing:
Defaults.itSettings
This will use a completely different setup from regular tests, including test code (goes to src/it/scala/ ) and libraries, so this may not be the way you want.
defining your own configuration
Using sbt 0.13, you can define a custom configuration as follows in the build.sbt file:
val TeamCity = config("teamcity") extend(Test) val root = project.in(file(".")). configs(TeamCity). settings(, ...)
teamcity: test definition
Now you need to figure out how to define teamcity:test .
Edit : Mark Harra pointed out to me that there is documentation for this. See Additional test configurations with shared sources .
An alternative to adding separate sets of test sources (and compilations) is sharing sources. In this approach, sources are compiled using the same class path and packaged together.
together
val TeamCity = config("teamcity") extend(Test) val root = project.in(file(".")). configs(TeamCity). settings( name := "helloworld", libraryDependencies ++= Seq( "org.specs2" %% "specs2" % "2.2" % "test" ) ). settings(inConfig(TeamCity)(Defaults.testTasks ++ Seq( testOptions := Seq(Tests.Argument("nocolor")) )): _*)
When running teamcity:test output of Specs2 is displayed without color.
Eugene yokota
source share