From bedfb12163da3172f0abee76508648b635a64161 Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Fri, 28 Feb 2014 15:18:08 +0000 Subject: [PATCH] Making example specific to build.sbt (see discussion on https://github.com/sbt/sbt/pull/1139) --- src/sphinx/Detailed-Topics/Testing.rst | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/sphinx/Detailed-Topics/Testing.rst b/src/sphinx/Detailed-Topics/Testing.rst index 67704e7a2..c3ff52fa3 100644 --- a/src/sphinx/Detailed-Topics/Testing.rst +++ b/src/sphinx/Detailed-Topics/Testing.rst @@ -191,26 +191,19 @@ The setting: specifies that all tests will be executed in a single external JVM. See :doc:`Forking` for configuring standard options for forking. More control over how tests are assigned to JVMs and what options to pass to those is -available with :key:`testGrouping` key. For example: +available with :key:`testGrouping` key. For example in build.sbt: :: - import sbt._ - import Keys._ import Tests._ - import Defaults._ - object ForkTestsBuild extends Build { + { def groupByFirst(tests: Seq[TestDefinition]) = tests groupBy (_.name(0)) map { case (letter, tests) => new Group(letter.toString, tests, SubProcess(Seq("-Dfirst.letter"+letter))) } toSeq - lazy val root = Project("root", file("."), settings = defaultSettings ++ Seq( - scalaVersion := "2.10.3", - testGrouping in Test := groupByFirst( (definedTests in Test).value ), - libraryDependencies += "org.scalatest" %% "scalatest" % "2.0" % "test" - )) + testGrouping in Test <<= groupByFirst( (definedTests in Test).value ) } The tests in a single group are run sequentially. Control the number