@@ -176,20 +176,20 @@ trait ParallelTesting extends RunnerOrchestration { self =>
176
176
) extends TestSource {
177
177
case class Group (ordinal : Int , compiler : String , target : String )
178
178
179
- def compilationGroups : List [(Group , Array [JFile ])] =
180
- val Name = """ [^_]*((?:_.*)*)\.\w+""" .r
179
+ lazy val compilationGroups : List [(Group , Array [JFile ])] =
181
180
val Target = """ t([\d\.]+)""" .r
182
181
val Compiler = """ v([\d\.]+)""" .r
183
182
val Ordinal = """ (\d+)""" .r
184
183
def groupFor (file : JFile ): Group =
185
- val Name ( annotPart) = file.getName
184
+ val annotPart = file.getName.dropWhile(_ != '_' ).stripSuffix( " .scala " ).stripSuffix( " .java " )
186
185
val annots = annotPart.split(" _" )
187
186
val ordinal = annots.collectFirst { case Ordinal (n) => n.toInt }.getOrElse(Int .MinValue )
188
187
val target = annots.collectFirst { case Target (t) => t }.getOrElse(" " )
189
188
val compiler = annots.collectFirst { case Compiler (c) => c}.getOrElse(" " )
190
189
Group (ordinal, compiler, target)
191
190
192
191
dir.listFiles
192
+ .filter(isSourceFile)
193
193
.groupBy(groupFor)
194
194
.toList
195
195
.sortBy { (g, _) => (g.ordinal, g.compiler, g.target) }
@@ -1255,14 +1255,14 @@ trait ParallelTesting extends RunnerOrchestration { self =>
1255
1255
val (dirs, files) = compilationTargets(sourceDir, fileFilter)
1256
1256
1257
1257
val isPicklerTest = flags.options.contains(" -Ytest-pickler" )
1258
- def ignoreDir ( dir : JFile ): Boolean = {
1258
+ def picklerDirFilter ( source : SeparateCompilationSource ): Boolean = {
1259
1259
// Pickler tests stop after pickler not producing class/tasty files. The second part of the compilation
1260
1260
// will not be able to compile due to the missing artifacts from the first part.
1261
- isPicklerTest && dir.listFiles().exists(file => file.getName.endsWith( " _2.scala " ) || file.getName.endsWith( " _2.java " ))
1261
+ ! isPicklerTest || source.compilationGroups.length == 1
1262
1262
}
1263
1263
val targets =
1264
1264
files.map(f => JointCompilationSource (testGroup.name, Array (f), flags, createOutputDirsForFile(f, sourceDir, outDir))) ++
1265
- dirs.collect { case dir if ! ignoreDir(dir) => SeparateCompilationSource (testGroup.name, dir, flags, createOutputDirsForDir(dir, sourceDir, outDir)) }
1265
+ dirs.map { dir => SeparateCompilationSource (testGroup.name, dir, flags, createOutputDirsForDir(dir, sourceDir, outDir)) }.filter(picklerDirFilter)
1266
1266
1267
1267
// Create a CompilationTest and let the user decide whether to execute a pos or a neg test
1268
1268
new CompilationTest (targets)
0 commit comments