@@ -38,10 +38,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
38
38
*/
39
39
def isInteractive : Boolean
40
40
41
- /** A regex which is used to filter which tests to run, if `None` will run
42
- * all tests
41
+ /** A string which is used to filter which tests to run, if `None` will run
42
+ * all tests. All absolute paths that contain the substring `testFilter`
43
+ * will be run
43
44
*/
44
- def testFilter : Option [Regex ]
45
+ def testFilter : Option [String ]
45
46
46
47
/** A test source whose files or directory of files is to be compiled
47
48
* in a specific way defined by the `Test`
@@ -51,14 +52,14 @@ trait ParallelTesting extends RunnerOrchestration { self =>
51
52
def outDir : JFile
52
53
def flags : Array [String ]
53
54
54
- def classPath : String = {
55
- val (beforeCp, cpAndAfter) = flags.toList.span(_ != " -classpath " )
56
- if (cpAndAfter.nonEmpty) {
57
- val (_ :: cpArg :: _) = cpAndAfter
58
- s " ${outDir.getAbsolutePath} : " + cpArg
59
- }
60
- else outDir.getAbsolutePath
61
- }
55
+ def classPath : String =
56
+ outDir.getAbsolutePath +
57
+ flags
58
+ .dropWhile (_ != " -classpath " )
59
+ .drop( 1 )
60
+ .headOption
61
+ .map( " : " + _)
62
+ .getOrElse( " " )
62
63
63
64
64
65
def title : String = self match {
@@ -224,9 +225,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
224
225
if (! testFilter.isDefined) testSources
225
226
else testSources.filter {
226
227
case JointCompilationSource (_, files, _, _) =>
227
- files.exists(file => testFilter.get.findFirstIn(file.getAbsolutePath).isDefined )
228
+ files.exists(file => file.getAbsolutePath.contains(testFilter.get) )
228
229
case SeparateCompilationSource (_, dir, _, _) =>
229
- testFilter.get.findFirstIn(dir.getAbsolutePath).isDefined
230
+ dir.getAbsolutePath.contains(testFilter.get)
230
231
}
231
232
232
233
/** Total amount of test sources being compiled by this test */
@@ -420,7 +421,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
420
421
}
421
422
else echo {
422
423
testFilter
423
- .map(r => s """ No files matched regex " $r" in test """ )
424
+ .map(r => s """ No files matched " $r" in test """ )
424
425
.getOrElse(" No tests available under target - erroneous test?" )
425
426
}
426
427
@@ -475,7 +476,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
475
476
summaryReport.addStartingMessage {
476
477
""" |WARNING
477
478
|-------
478
- |Run tests were only compiled, not run - this is due to `dotty.tests.norun`
479
+ |Run tests were only compiled, not run - this is due to the `dotty.tests.norun`
479
480
|property being set
480
481
|""" .stripMargin
481
482
}
0 commit comments