Skip to content

Commit 8bfc4ec

Browse files
committed
Fix step4 not able to see availavble tests
They only exist after step3 has been executed
1 parent 11fe1b9 commit 8bfc4ec

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

compiler/test/dotty/tools/dotc/FromTastyTests.scala

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FromTastyTests extends ParallelTesting {
2626
// > dotc -Ythrough-tasty -Ycheck:all <source>
2727

2828
implicit val testGroup: TestGroup = TestGroup("posTestFromTasty")
29-
val (step1, step2, step3, step4) = compileTastyInDir("tests/pos", defaultOptions,
29+
val (step1, step2, step3, decompilationDir) = compileTastyInDir("tests/pos", defaultOptions,
3030
blacklist = Set(
3131
// Wrong number of arguments (only on bootstrapped)
3232
"i3130b.scala",
@@ -36,15 +36,19 @@ class FromTastyTests extends ParallelTesting {
3636

3737
// MatchError in SymDenotation.sourceModule on a ThisType
3838
"t3612.scala",
39-
),
40-
recompileBlacklist = Set(
41-
"simpleCaseObject"
4239
)
4340
)
4441
step1.checkCompile() // Compile all files to generate the class files with tasty
4542
step2.checkCompile() // Compile from tasty
4643
step3.checkCompile() // Decompile from tasty
44+
45+
val step4 = compileFilesInDir(decompilationDir, defaultOptions,
46+
blacklist = Set(
47+
"simpleCaseObject"
48+
)
49+
).keepOutput
4750
step4.checkCompile() // Recompile decompiled code
51+
4852
(step1 + step2 + step3 + step4).delete()
4953
}
5054

@@ -55,18 +59,19 @@ class FromTastyTests extends ParallelTesting {
5559
// > dotr Test
5660

5761
implicit val testGroup: TestGroup = TestGroup("runTestFromTasty")
58-
val (step1, step2, step3, step4) = compileTastyInDir("tests/run", defaultOptions,
62+
val (step1, step2, step3, decompilationDir) = compileTastyInDir("tests/run", defaultOptions,
5963
blacklist = Set(
6064
// Closure type miss match
6165
"eff-dependent.scala",
62-
),
63-
recompileBlacklist = Set(
6466
)
6567
)
6668
step1.checkCompile() // Compile all files to generate the class files with tasty
6769
step2.checkRuns() // Compile from tasty and run the result
6870
step3.checkCompile() // Decompile from tasty
69-
step4.checkRuns() // Recompile decompiled code
71+
72+
val step4 = compileFilesInDir(decompilationDir, defaultOptions, blacklist = Set()).keepOutput
73+
step4.checkRuns() // Recompile and run decompiled code
74+
7075
(step1 + step2 + step3 + step4).delete()
7176
}
7277

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,8 +1258,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12581258
* Tests in the first part of the tuple must be executed before the second.
12591259
* Both testsRequires explicit delete().
12601260
*/
1261-
def compileTastyInDir(f: String, flags0: TestFlags, blacklist: Set[String], recompileBlacklist: Set[String])(
1262-
implicit testGroup: TestGroup): (CompilationTest, CompilationTest, CompilationTest, CompilationTest) = {
1261+
def compileTastyInDir(f: String, flags0: TestFlags, blacklist: Set[String])(
1262+
implicit testGroup: TestGroup): (CompilationTest, CompilationTest, CompilationTest, String) = {
12631263
val outDir = defaultOutputDir + testGroup + "/"
12641264
val flags = flags0 and "-Yretain-trees"
12651265
val sourceDir = new JFile(f)
@@ -1286,14 +1286,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12861286
val generateClassFiles = compileFilesInDir(f, flags0, blacklist)
12871287

12881288
val decompilationDir = outDir + sourceDir.getName + "_decompiled"
1289-
new JFile(decompilationDir).mkdirs()
1290-
val recompileDecompiled = compileFilesInDir(decompilationDir, flags0, recompileBlacklist)
12911289

12921290
(
12931291
generateClassFiles.keepOutput,
12941292
new CompilationTest(targets).keepOutput,
12951293
new CompilationTest(targets2).keepOutput,
1296-
recompileDecompiled.keepOutput
1294+
decompilationDir
12971295
)
12981296
}
12991297

0 commit comments

Comments
 (0)