Skip to content

Commit d4bb969

Browse files
Merge pull request #3693 from dotty-staging/regeression-tests-for-#3594
Add regression tests for #3594
2 parents b61a193 + 90c6146 commit d4bb969

17 files changed

+71
-70
lines changed

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

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -22,76 +22,75 @@ class FromTastyTests extends ParallelTesting {
2222

2323
@Test def posTestFromTasty: Unit = {
2424
implicit val testGroup: TestGroup = TestGroup("posTestFromTasty")
25-
val (step1, step2) = {
26-
// compileTastyInDir("../tests/pos", defaultOptions) + // FIXME
27-
// compileTasty("../tests/pos/t115.scala", defaultOptions) +
28-
// compileTasty("../tests/pos/t2127.scala", defaultOptions) +
29-
// compileTasty("../tests/pos/i1570.scala", defaultOptions) +
30-
// compileTasty("../tests/pos/t1279a.scala", defaultOptions) +
31-
// compileTasty("../tests/pos/i3129.scala", defaultOptions) +
32-
// compileTasty("../tests/pos/i2250.scala", defaultOptions) +
33-
// compileTasty("../tests/pos/i966.scala", defaultOptions) +
34-
// compileTasty("../tests/pos/t0049.scala", defaultOptions) +
35-
// compileTasty("../tests/pos/i0306.scala", defaultOptions) +
36-
// compileTasty("../tests/pos/t0055.scala", defaultOptions) +
37-
// compileTasty("../tests/pos/i2397.scala", defaultOptions) +
38-
// compileTasty("../tests/pos/i1365.scala", defaultOptions) +
39-
// compileTasty("../tests/pos/t1957.scala", defaultOptions) +
40-
// compileTasty("../tests/pos/i1756.scala", defaultOptions) +
41-
// compileTasty("../tests/pos/i3130d.scala", defaultOptions) +
42-
// compileTasty("../tests/pos/i1990a.scala", defaultOptions) +
43-
// compileTasty("../tests/pos/i996.scala", defaultOptions) +
44-
// compileTasty("../tests/pos/companions.scala", defaultOptions) +
45-
// compileTasty("../tests/pos/i1812.scala", defaultOptions) +
46-
// compileTasty("../tests/pos/i2944.scala", defaultOptions) +
47-
// compileTasty("../tests/pos/i2468.scala", defaultOptions) +
48-
// compileTasty("../tests/pos/i2300.scala", defaultOptions) +
49-
// compileTasty("../tests/pos/i1990.scala", defaultOptions) +
50-
// compileTasty("../tests/pos/i1812b.scala", defaultOptions) +
51-
// compileTasty("../tests/pos/t2405.scala", defaultOptions) +
52-
// compileTasty("../tests/pos/supercalls.scala", defaultOptions) +
53-
// compileTasty("../tests/pos/hklub0.scala", defaultOptions) +
54-
// compileTasty("../tests/pos/i3130a.scala", defaultOptions) +
55-
compileTastyInDir("../tests/pos-from-tasty", defaultOptions) +
56-
compileTasty("../tests/pos-from-tasty/simpleClass.scala", defaultOptions)
57-
}
25+
val (step1, step2) = compileTastyInDir("../tests/pos", defaultOptions,
26+
blacklist = Set(
27+
"Meter.scala",
28+
"NoCyclicReference.scala",
29+
"depfuntype.scala",
30+
"hklub0.scala",
31+
"i0306.scala",
32+
"i1365.scala",
33+
"i1795.scala",
34+
"i2345.scala",
35+
"i2888.scala",
36+
"i2944.scala",
37+
"i2980.scala",
38+
"i3000.scala",
39+
"i536.scala",
40+
"i974.scala",
41+
"liftable.scala",
42+
"quoteTest.scala",
43+
"quoted.scala",
44+
"stagedInterpreter.scala",
45+
"superacc.scala",
46+
"t0231.scala",
47+
"t1203a.scala",
48+
"t2260.scala",
49+
"t3612.scala", // Test never finishes
50+
"t3800.scala",
51+
"t4579.scala",
52+
"t8023.scala",
53+
"tcpoly_ticket2096.scala",
54+
"t247.scala",
55+
)
56+
)
5857
step1.checkCompile() // Compile all files to generate the class files with tasty
5958
step2.checkCompile() // Compile from tasty
6059
(step1 + step2).delete()
6160
}
6261

6362
@Test def runTestFromTasty: Unit = {
6463
implicit val testGroup: TestGroup = TestGroup("runTestFromTasty")
65-
val (step1, step2) = {
66-
// compileTastyInDir("../tests/run", defaultOptions) + // FIXME
67-
// compileTasty("../tests/run/t3613.scala", defaultOptions) +
68-
// compileTasty("../tests/run/i1569.scala", defaultOptions) +
69-
// compileTasty("../tests/run/i2337.scala", defaultOptions) +
70-
// compileTasty("../tests/run/t2127.scala", defaultOptions) +
71-
// compileTasty("../tests/run/scala2trait-lazyval.scala", defaultOptions) +
72-
// compileTasty("../tests/run/t6666a.scala", defaultOptions) +
73-
// compileTasty("../tests/run/t3452f.scala", defaultOptions) +
74-
// compileTasty("../tests/run/t6957.scala", defaultOptions) +
75-
// compileTasty("../tests/run/inlinedAssign.scala", defaultOptions) +
76-
// compileTasty("../tests/run/bridges.scala", defaultOptions) +
77-
// compileTasty("../tests/run/t8002.scala", defaultOptions) +
78-
// compileTasty("../tests/run/t6506.scala", defaultOptions) +
79-
// compileTasty("../tests/run/enum-approx.scala", defaultOptions) +
80-
// compileTasty("../tests/run/i2337b.scala", defaultOptions) +
81-
// compileTasty("../tests/run/array-addition.scala", defaultOptions) +
82-
// compileTasty("../tests/run/t1909c.scala", defaultOptions) +
83-
// compileTasty("../tests/run/i2163.scala", defaultOptions) +
84-
// compileTasty("../tests/run/t8395.scala", defaultOptions) +
85-
// compileTasty("../tests/run/view-iterator-stream.scala", defaultOptions) +
86-
// compileTasty("../tests/run/Course-2002-13.scala", defaultOptions) +
87-
// compileTasty("../tests/run/NestedClasses.scala", defaultOptions) +
88-
// compileTasty("../tests/run/inlineForeach.scala", defaultOptions) +
89-
// compileTasty("../tests/run/i1990b.scala", defaultOptions) +
90-
// compileTasty("../tests/run/t3048.scala", defaultOptions) +
91-
// compileTasty("../tests/run/patmat-bind-typed.scala", defaultOptions) +
92-
compileTastyInDir("../tests/run-from-tasty", defaultOptions) +
93-
compileTasty("../tests/run/t493.scala", defaultOptions)
94-
}
64+
val (step1, step2) = compileTastyInDir("../tests/run", defaultOptions,
65+
blacklist = Set(
66+
"Course-2002-13.scala",
67+
"NestedClasses.scala",
68+
"bridges.scala",
69+
"eff-dependent.scala",
70+
"enum-approx.scala",
71+
"i2337.scala",
72+
"i2337b.scala",
73+
"inlineForeach.scala",
74+
"patmat-bind-typed.scala",
75+
"phantom-decls-1.scala",
76+
"phantom-decls-3.scala",
77+
"phantom-decls-5.scala",
78+
"phantom-hk-1.scala",
79+
"phantom-hk-2.scala",
80+
"phantom-in-value-class.scala",
81+
"phantom-methods-3.scala",
82+
"phantom-methods-4.scala",
83+
"phantom-poly-1.scala",
84+
"phantom-poly-2.scala",
85+
"phantom-poly-3.scala",
86+
"phantom-poly-4.scala",
87+
"scala2trait-lazyval.scala",
88+
"t3452f.scala",
89+
"t493.scala",
90+
"t8395.scala",
91+
"t3613.scala",
92+
)
93+
)
9594
step1.checkCompile() // Compile all files to generate the class files with tasty
9695
step2.checkRuns() // Compile from tasty and run the result
9796
(step1 + step2).delete()

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,9 +1049,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10491049
}
10501050

10511051
/** Separates directories from files and returns them as `(dirs, files)` */
1052-
private def compilationTargets(sourceDir: JFile): (List[JFile], List[JFile]) =
1052+
private def compilationTargets(sourceDir: JFile, blacklist: Set[String] = Set.empty): (List[JFile], List[JFile]) =
10531053
sourceDir.listFiles.foldLeft((List.empty[JFile], List.empty[JFile])) { case ((dirs, files), f) =>
1054-
if (f.isDirectory) (f :: dirs, files)
1054+
if (blacklist(f.getName)) (dirs, files)
1055+
else if (f.isDirectory) (f :: dirs, files)
10551056
else if (isSourceFile(f)) (dirs, f :: files)
10561057
else (dirs, files)
10571058
}
@@ -1176,12 +1177,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
11761177
* - Directories can have an associated check-file, where the check file has
11771178
* the same name as the directory (with the file extension `.check`)
11781179
*/
1179-
def compileFilesInDir(f: String, flags: TestFlags)(implicit testGroup: TestGroup): CompilationTest = {
1180+
def compileFilesInDir(f: String, flags: TestFlags, blacklist: Set[String] = Set.empty)(implicit testGroup: TestGroup): CompilationTest = {
11801181
val outDir = defaultOutputDir + testGroup + "/"
11811182
val sourceDir = new JFile(f)
11821183
checkRequirements(f, sourceDir, outDir)
11831184

1184-
val (dirs, files) = compilationTargets(sourceDir)
1185+
val (dirs, files) = compilationTargets(sourceDir, blacklist)
11851186

11861187
val targets =
11871188
files.map(f => JointCompilationSource(testGroup.name, Array(f), flags, createOutputDirsForFile(f, sourceDir, outDir))) ++
@@ -1211,13 +1212,14 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12111212
* Tests in the first part of the tuple must be executed before the second.
12121213
* Both testsRequires explicit delete().
12131214
*/
1214-
def compileTastyInDir(f: String, flags0: TestFlags)(implicit testGroup: TestGroup): (CompilationTest, CompilationTest) = {
1215+
def compileTastyInDir(f: String, flags0: TestFlags, blacklist: Set[String] = Set.empty)(
1216+
implicit testGroup: TestGroup): (CompilationTest, CompilationTest) = {
12151217
val outDir = defaultOutputDir + testGroup + "/"
12161218
val flags = flags0 and "-Yretain-trees"
12171219
val sourceDir = new JFile(f)
12181220
checkRequirements(f, sourceDir, outDir)
12191221

1220-
val (dirs, files) = compilationTargets(sourceDir)
1222+
val (dirs, files) = compilationTargets(sourceDir, blacklist)
12211223

12221224
val targets =
12231225
files.map { f =>
@@ -1227,7 +1229,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12271229
// TODO add SeparateCompilationSource from tasty?
12281230

12291231
// Create a CompilationTest and let the user decide whether to execute a pos or a neg test
1230-
val generateClassFiles = compileFilesInDir(f, flags0)
1232+
val generateClassFiles = compileFilesInDir(f, flags0, blacklist)
12311233
(generateClassFiles.keepOutput, new CompilationTest(targets).keepOutput)
12321234
}
12331235

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)