@@ -45,11 +45,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
45
45
*/
46
46
def isInteractive : Boolean
47
47
48
- /** A string which is used to filter which tests to run, if `None ` will run
49
- * all tests. All absolute paths that contain the substring `testFilter`
48
+ /** A list of strings which is used to filter which tests to run, if `Nil ` will run
49
+ * all tests. All absolute paths that contain any of the substrings in `testFilter`
50
50
* will be run
51
51
*/
52
- def testFilter : Option [String ]
52
+ def testFilter : List [String ]
53
53
54
54
/** Tests should override the checkfiles with the current output */
55
55
def updateCheckFiles : Boolean
@@ -344,12 +344,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
344
344
345
345
/** All testSources left after filtering out */
346
346
private val filteredSources =
347
- if (! testFilter.isDefined ) testSources
347
+ if (testFilter.isEmpty ) testSources
348
348
else testSources.filter {
349
349
case JointCompilationSource (_, files, _, _, _, _) =>
350
- files.exists(file => file.getPath.contains(testFilter.get ))
350
+ testFilter.exists(filter => files.exists(file => file.getPath.contains(filter) ))
351
351
case SeparateCompilationSource (_, dir, _, _) =>
352
- dir.getPath.contains(testFilter.get )
352
+ testFilter.exists( dir.getPath.contains)
353
353
}
354
354
355
355
/** Total amount of test sources being compiled by this test */
@@ -628,9 +628,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
628
628
else reportPassed()
629
629
}
630
630
else echo {
631
- testFilter
632
- .map(r => s """ No files matched " $r " in test""" )
633
- .getOrElse( " No tests available under target - erroneous test?" )
631
+ testFilter match
632
+ case _ :: _ => s """ No files matched " ${testFilter.mkString( " , " )} " in test"""
633
+ case _ => " No tests available under target - erroneous test?"
634
634
}
635
635
636
636
this
@@ -1316,10 +1316,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
1316
1316
1317
1317
val (dirs, files) = compilationTargets(sourceDir, fromTastyFilter)
1318
1318
1319
- val filteredFiles = testFilter match {
1320
- case Some (str) => files.filter(_.getPath.contains(str))
1321
- case None => files
1322
- }
1319
+ val filteredFiles = testFilter match
1320
+ case _ :: _ => files.filter(f => testFilter.exists(f.getPath.contains))
1321
+ case _ => Nil
1323
1322
1324
1323
class JointCompilationSourceFromTasty (
1325
1324
name : String ,
0 commit comments