From 1658d79ba284069b039d391c53eb1ce626b8a9fd Mon Sep 17 00:00:00 2001 From: ezh Date: Mon, 22 Oct 2012 09:32:26 -0700 Subject: [PATCH] add alternative way to filter tests. It may be useful for 3rd party plugins --- Detailed-Topics/Testing.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Detailed-Topics/Testing.md b/Detailed-Topics/Testing.md index b361b06..4741e82 100644 --- a/Detailed-Topics/Testing.md +++ b/Detailed-Topics/Testing.md @@ -141,10 +141,18 @@ parallelExecution in Test := false If you want to only run test classes whose name ends with "Test", use `Tests.Filter`: -``` +```scala testOptions in Test := Seq(Tests.Filter(s => s.endsWith("Test"))) ``` +or if you want remove other tests from `detected-tests` for some reason: +```scala +definedTests in Test <<= (definedTests in Test) { + (tests) => + def filter(tests: Seq[TestDefinition]) = tests.filter(t => t.name.endsWith("Test")) + tests map filter +} +``` ## Forking tests In version 0.12 the facility to run tests in a separate JVM has been added. The setting