Skip to content

Commit b4d8202

Browse files
committed
Fix step4 not able to see availavble tests
They only exist after step3 has been executed
1 parent b7c793f commit b4d8202

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
@@ -1260,8 +1260,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12601260
* Tests in the first part of the tuple must be executed before the second.
12611261
* Both testsRequires explicit delete().
12621262
*/
1263-
def compileTastyInDir(f: String, flags0: TestFlags, blacklist: Set[String], recompileBlacklist: Set[String])(
1264-
implicit testGroup: TestGroup): (CompilationTest, CompilationTest, CompilationTest, CompilationTest) = {
1263+
def compileTastyInDir(f: String, flags0: TestFlags, blacklist: Set[String])(
1264+
implicit testGroup: TestGroup): (CompilationTest, CompilationTest, CompilationTest, String) = {
12651265
val outDir = defaultOutputDir + testGroup + "/"
12661266
val flags = flags0 and "-Yretain-trees"
12671267
val sourceDir = new JFile(f)
@@ -1288,14 +1288,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12881288
val generateClassFiles = compileFilesInDir(f, flags0, blacklist)
12891289

12901290
val decompilationDir = outDir + sourceDir.getName + "_decompiled"
1291-
new JFile(decompilationDir).mkdirs()
1292-
val recompileDecompiled = compileFilesInDir(decompilationDir, flags0, recompileBlacklist)
12931291

12941292
(
12951293
generateClassFiles.keepOutput,
12961294
new CompilationTest(targets).keepOutput,
12971295
new CompilationTest(targets2).keepOutput,
1298-
recompileDecompiled.keepOutput
1296+
decompilationDir
12991297
)
13001298
}
13011299

0 commit comments

Comments
 (0)