Skip to content

Commit 25bb83a

Browse files
committed
Cleanup tests based on multiple test groups
1 parent 67b2ffe commit 25bb83a

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

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

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,14 @@ class CompilationTests extends ParallelTesting {
241241
*/
242242
@Test def tastyBootstrap: Unit = {
243243
implicit val testGroup: TestGroup = TestGroup("tastyBootstrap")
244+
val testGroup1 = TestGroup("dotty1")
245+
val testGroup2 = TestGroup("dotty2")
244246

245247
val opt = TestFlags(
246248
// compile with bootstrapped library on cp:
247249
defaultOutputDir + "lib/src/:" +
248250
// as well as bootstrapped compiler:
249-
defaultOutputDir + "dotty1/dotty/:" +
251+
defaultOutputDir + testGroup1.name + "/dotty/:" +
250252
Jars.dottyInterfaces,
251253
Array("-Ycheck-reentrant")
252254
)
@@ -272,19 +274,9 @@ class CompilationTests extends ParallelTesting {
272274
val backendJvmSources =
273275
sources(Files.list(backendJvmDir), excludedFiles = backendJvmExcluded)
274276

275-
def dotty1 = {
276-
compileList(
277-
"dotty",
278-
compilerSources ++ backendSources ++ backendJvmSources,
279-
opt)(TestGroup("dotty1"))
280-
}
277+
val dotty1 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources, opt)(testGroup1)
278+
val dotty2 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources, opt)(testGroup2)
281279

282-
def dotty2 = {
283-
compileList(
284-
"dotty",
285-
compilerSources ++ backendSources ++ backendJvmSources,
286-
opt)(TestGroup("dotty2"))
287-
}
288280

289281
val tests = {
290282
lib.keepOutput :: dotty1.keepOutput :: {
@@ -305,8 +297,8 @@ class CompilationTests extends ParallelTesting {
305297
}.keepOutput :: Nil
306298
}.map(_.checkCompile())
307299

308-
assert(new java.io.File("../out/dotty1/dotty/").exists)
309-
assert(new java.io.File("../out/dotty2/dotty/").exists)
300+
assert(new java.io.File(s"../out/${testGroup1.name}/dotty/").exists)
301+
assert(new java.io.File(s"../out/${testGroup2.name}/dotty/").exists)
310302
compileList("idempotency", List("../tests/idempotency/BootstrapChecker.scala", "../tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns()
311303

312304
tests.foreach(_.delete())

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ class LinkOptimiseTests extends ParallelTesting {
2828

2929
@Test def linkOptimise: Unit = {
3030
// Setup and compile libraries
31-
def strawmanLibrary =
32-
compileDir("../collection-strawman/collections/src/main", defaultOptions)(TestGroup("strawmanLibrary"))
33-
def linkCustomLib =
34-
compileDir("../tests/link/custom-lib", defaultOptions)(TestGroup("linkCustomLib"))
31+
val strawmanLibGroup = TestGroup("strawmanLibrary")
32+
val strawmanLibTestGroup = TestGroup(strawmanLibGroup.name + "/tests")
33+
34+
val linkCustomLibGroup = TestGroup("linkCustomLib")
35+
val linkCustomLibTestGroup = TestGroup(linkCustomLibGroup.name + "/tests")
36+
37+
val strawmanLibrary = compileDir("../collection-strawman/collections/src/main", defaultOptions)(strawmanLibGroup)
38+
val linkCustomLib = compileDir("../tests/link/custom-lib", defaultOptions)(linkCustomLibGroup)
3539

3640
val libraries = {
3741
strawmanLibrary +
@@ -41,15 +45,16 @@ class LinkOptimiseTests extends ParallelTesting {
4145
// Setup class paths
4246
def mkLinkClassFlags(libPath: String) =
4347
TestFlags(mkClassPath(libPath :: Jars.dottyTestDeps), mkClassPath(Jars.dottyTestDeps), basicDefaultOptions :+ "-Xlink-optimise")
44-
val strawmanClassPath = mkLinkClassFlags(defaultOutputDir + "strawmanLibrary/main/")
45-
val customLibClassFlags = mkLinkClassFlags(defaultOutputDir + "linkCustomLib/custom-lib")
48+
val strawmanClassPath = mkLinkClassFlags(defaultOutputDir + strawmanLibGroup.name + "/main/")
49+
val customLibClassFlags = mkLinkClassFlags(defaultOutputDir + linkCustomLibGroup.name + "/custom-lib")
4650

4751
// Link tests
4852
val linkDir = "../tests/link"
4953
val linkStramanDir = linkDir + "/strawman"
5054
val linkCustomLibDir = linkDir + "/on-custom-lib"
51-
def linkStrawmanTest = compileFilesInDir(linkStramanDir, strawmanClassPath)(TestGroup("linkStrawmanTest"))
52-
def linkCustomLibTest = compileFilesInDir(linkCustomLibDir, customLibClassFlags)(TestGroup("linkCustomLibTest"))
55+
56+
val linkStrawmanTest = compileFilesInDir(linkStramanDir, strawmanClassPath)(strawmanLibTestGroup)
57+
val linkCustomLibTest = compileFilesInDir(linkCustomLibDir, customLibClassFlags)(linkCustomLibTestGroup)
5358

5459
def classFileChecks(sourceDir: String, testName: String) = {
5560
val checkExt = ".classcheck"
@@ -73,8 +78,8 @@ class LinkOptimiseTests extends ParallelTesting {
7378
}.keepOutput.checkRuns()
7479

7580
try {
76-
classFileChecks(linkStramanDir, "linkStrawmanTest")
77-
classFileChecks(linkCustomLibDir, "linkCustomLibTest")
81+
classFileChecks(linkStramanDir, strawmanLibTestGroup.name)
82+
classFileChecks(linkCustomLibDir, linkCustomLibTestGroup.name)
7883
} finally {
7984
(libraries + tests).delete()
8085
}

0 commit comments

Comments
 (0)