Skip to content

Commit 4d731fc

Browse files
committed
Make compileTasty and compileTastyInDir always keep the output
1 parent ce699fc commit 4d731fc

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class FromTastyTests extends ParallelTesting {
2727
compileTastyInDir("../tests/pos-from-tasty", defaultOptions) +
2828
compileTasty("../tests/pos-from-tasty/simpleClass.scala", defaultOptions)
2929
}
30-
step1.keepOutput.checkCompile() // Compile all files to generate the class files with tasty
31-
step2.keepOutput.checkCompile() // Compile from tasty
30+
step1.checkCompile() // Compile all files to generate the class files with tasty
31+
step2.checkCompile() // Compile from tasty
3232
(step1 + step2).delete()
3333
}
3434

@@ -39,8 +39,8 @@ class FromTastyTests extends ParallelTesting {
3939
compileTastyInDir("../tests/run-from-tasty", defaultOptions) +
4040
compileTasty("../tests/run/t493.scala", defaultOptions)
4141
}
42-
step1.keepOutput.checkCompile() // Compile all files to generate the class files with tasty
43-
step2.keepOutput.checkRuns() // Compile from tasty and run the result
42+
step1.checkCompile() // Compile all files to generate the class files with tasty
43+
step2.checkRuns() // Compile from tasty and run the result
4444
(step1 + step2).delete()
4545
}
4646

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10761076
new CompilationTest(target)
10771077
}
10781078

1079-
/** Compiles a single file from the string path `f` using the supplied flags */
1079+
/** Compiles a single file from the string path `f` using the supplied flags
1080+
*
1081+
* Tests in the first part of the tuple must be executed before the second.
1082+
* Both testsRequires explicit delete().
1083+
*/
10801084
def compileTasty(f: String, flags: TestFlags)(implicit testGroup: TestGroup): (CompilationTest, CompilationTest) = {
10811085
val sourceFile = new JFile(f)
10821086
val parent = sourceFile.getParentFile
@@ -1097,7 +1101,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10971101
tastySource,
10981102
fromTasty = true
10991103
)
1100-
(compileFile(f, flags), new CompilationTest(target))
1104+
(compileFile(f, flags).keepOutput, new CompilationTest(target).keepOutput)
11011105
}
11021106

11031107
/** Compiles a directory `f` using the supplied `flags`. This method does
@@ -1197,6 +1201,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
11971201
* with file extension `.check`)
11981202
* - Directories can have an associated check-file, where the check file has
11991203
* the same name as the directory (with the file extension `.check`)
1204+
*
1205+
* Tests in the first part of the tuple must be executed before the second.
1206+
* Both testsRequires explicit delete().
12001207
*/
12011208
def compileTastyInDir(f: String, flags0: TestFlags)(implicit testGroup: TestGroup): (CompilationTest, CompilationTest) = {
12021209
val outDir = defaultOutputDir + testGroup + "/"
@@ -1215,7 +1222,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12151222

12161223
// Create a CompilationTest and let the user decide whether to execute a pos or a neg test
12171224
val generateClassFiles = compileFilesInDir(f, flags0)
1218-
(generateClassFiles, new CompilationTest(targets))
1225+
(generateClassFiles.keepOutput, new CompilationTest(targets).keepOutput)
12191226
}
12201227

12211228

0 commit comments

Comments
 (0)