aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-12 11:18:31 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-04-12 11:48:40 +0200
commit7c4227709666e5390afa1b5f43aeb3c32cc93016 (patch)
tree756e539bd8a3a9d2b65ba21a76ab38c548601501
parentbcdacee46f04f5bca4732bd487d3cc3c042e23db (diff)
downloaddotty-7c4227709666e5390afa1b5f43aeb3c32cc93016.tar.gz
dotty-7c4227709666e5390afa1b5f43aeb3c32cc93016.tar.bz2
dotty-7c4227709666e5390afa1b5f43aeb3c32cc93016.zip
Make vulpix test filter work on substring instead of regexp
-rw-r--r--compiler/test/dotty/tools/dotc/CompilationTests.scala2
-rw-r--r--compiler/test/dotty/tools/vulpix/ParallelTesting.scala31
2 files changed, 17 insertions, 16 deletions
diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala
index 023a87069..fa0c89f28 100644
--- a/compiler/test/dotty/tools/dotc/CompilationTests.scala
+++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala
@@ -19,7 +19,7 @@ class CompilationTests extends ParallelTesting {
def numberOfSlaves = 5
def safeMode = Properties.testsSafeMode
def isInteractive = SummaryReport.isInteractive
- def testFilter = Properties.testsFilter.map(r => new Regex(r))
+ def testFilter = Properties.testsFilter
// Positive tests ------------------------------------------------------------
diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
index 4c7328214..5957e3ec5 100644
--- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
+++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
@@ -38,10 +38,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
*/
def isInteractive: Boolean
- /** A regex which is used to filter which tests to run, if `None` will run
- * all tests
+ /** A string which is used to filter which tests to run, if `None` will run
+ * all tests. All absolute paths that contain the substring `testFilter`
+ * will be run
*/
- def testFilter: Option[Regex]
+ def testFilter: Option[String]
/** A test source whose files or directory of files is to be compiled
* in a specific way defined by the `Test`
@@ -51,14 +52,14 @@ trait ParallelTesting extends RunnerOrchestration { self =>
def outDir: JFile
def flags: Array[String]
- def classPath: String = {
- val (beforeCp, cpAndAfter) = flags.toList.span(_ != "-classpath")
- if (cpAndAfter.nonEmpty) {
- val (_ :: cpArg :: _) = cpAndAfter
- s"${outDir.getAbsolutePath}:" + cpArg
- }
- else outDir.getAbsolutePath
- }
+ def classPath: String =
+ outDir.getAbsolutePath +
+ flags
+ .dropWhile(_ != "-classpath")
+ .drop(1)
+ .headOption
+ .map(":" + _)
+ .getOrElse("")
def title: String = self match {
@@ -224,9 +225,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
if (!testFilter.isDefined) testSources
else testSources.filter {
case JointCompilationSource(_, files, _, _) =>
- files.exists(file => testFilter.get.findFirstIn(file.getAbsolutePath).isDefined)
+ files.exists(file => file.getAbsolutePath.contains(testFilter.get))
case SeparateCompilationSource(_, dir, _, _) =>
- testFilter.get.findFirstIn(dir.getAbsolutePath).isDefined
+ dir.getAbsolutePath.contains(testFilter.get)
}
/** Total amount of test sources being compiled by this test */
@@ -420,7 +421,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
}
else echo {
testFilter
- .map(r => s"""No files matched regex "$r" in test""")
+ .map(r => s"""No files matched "$r" in test""")
.getOrElse("No tests available under target - erroneous test?")
}
@@ -475,7 +476,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
summaryReport.addStartingMessage {
"""|WARNING
|-------
- |Run tests were only compiled, not run - this is due to `dotty.tests.norun`
+ |Run tests were only compiled, not run - this is due to the `dotty.tests.norun`
|property being set
|""".stripMargin
}