Skip to content

Commit acd270d

Browse files
committed
Fix the reproduction script for testFromTasty tests
1 parent 3e44d53 commit acd270d

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,9 +1274,30 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12741274
case None => files
12751275
}
12761276

1277+
class JointCompilationSourceFromTasty(
1278+
name: String,
1279+
file: JFile,
1280+
flags: TestFlags,
1281+
outDir: JFile,
1282+
fromTasty: Boolean = false,
1283+
decompilation: Boolean = false
1284+
) extends JointCompilationSource(name, Array(file), flags, outDir, fromTasty, decompilation) {
1285+
1286+
override def buildInstructions(errors: Int, warnings: Int): String = {
1287+
s"""|
1288+
|Test '$title' compiled with $errors error(s) and $warnings warning(s),
1289+
|the test can be reproduced by running:
1290+
|
1291+
| sbt "testFromTasty $file"
1292+
|
1293+
|""".stripMargin
1294+
}
1295+
1296+
}
1297+
12771298
val targets = filteredFiles.map { f =>
12781299
val classpath = createOutputDirsForFile(f, sourceDir, outDir)
1279-
JointCompilationSource(testGroup.name, Array(f), flags.withClasspath(classpath.getPath), classpath, fromTasty = true)
1300+
new JointCompilationSourceFromTasty(testGroup.name, f, flags.withClasspath(classpath.getPath), classpath, fromTasty = true)
12801301
}
12811302
// TODO add SeparateCompilationSource from tasty?
12821303

@@ -1285,7 +1306,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12851306
.filter(f => decompilationFilter.accept(f.getName))
12861307
.map { f =>
12871308
val classpath = createOutputDirsForFile(f, sourceDir, outDir)
1288-
JointCompilationSource(testGroup.name, Array(f), flags.withClasspath(classpath.getPath), classpath, decompilation = true)
1309+
new JointCompilationSourceFromTasty(testGroup.name, f, flags.withClasspath(classpath.getPath), classpath, decompilation = true)
12891310
}
12901311

12911312
// Create a CompilationTest and let the user decide whether to execute a pos or a neg test

0 commit comments

Comments
 (0)