Skip to content

Commit ed2feb2

Browse files
Merge pull request #3445 from dotty-staging/remove-vulpix-reflective-nightmare
Remove vulpix reflective nightmare
2 parents 28f6c3f + feebf3b commit ed2feb2

10 files changed

+90
-99
lines changed

compiler/test/dotc/comptest.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package dotc
22

3-
import dotty.tools.vulpix.{ParallelTesting, TestFlags}
3+
import dotty.tools.vulpix.{ParallelTesting, TestFlags, TestGroup}
44

55
import scala.concurrent.duration._
66

@@ -24,7 +24,6 @@ object comptest extends ParallelTesting {
2424
dotcDir + "tools/dotc/core/Types.scala",
2525
dotcDir + "tools/dotc/ast/Trees.scala"
2626
),
27-
TestFlags("", Array("-Ylog:frontend", "-Xprompt")),
28-
outDirectory = "."
29-
)
27+
TestFlags("", Array("-Ylog:frontend", "-Xprompt"))
28+
)(TestGroup("comptest"))
3029
}

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

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ class CompilationTests extends ParallelTesting {
3333

3434
// @Test // enable to test compileStdLib separately with detailed stats
3535
def compileStdLib: Unit = {
36+
implicit val testGroup: TestGroup = TestGroup("compileStdLib")
3637
compileList("compileStdLib", StdLibSources.whitelisted, scala2Mode.and("-migration", "-Yno-inline", "-Ydetailed-stats"))
3738
}.checkCompile()
3839

3940
@Test def compilePos: Unit = {
41+
implicit val testGroup: TestGroup = TestGroup("compilePos")
4042
compileList("compileStdLib", StdLibSources.whitelisted, scala2Mode.and("-migration", "-Yno-inline")) +
4143
compileDir("../compiler/src/dotty/tools/dotc/ast", defaultOptions) +
4244
compileDir("../compiler/src/dotty/tools/dotc/config", defaultOptions) +
@@ -102,6 +104,7 @@ class CompilationTests extends ParallelTesting {
102104
}.checkCompile()
103105

104106
@Test def posTwice: Unit = {
107+
implicit val testGroup: TestGroup = TestGroup("posTwice")
105108
compileFile("../tests/pos/Labels.scala", defaultOptions) +
106109
compileFilesInDir("../tests/pos-java-interop", defaultOptions) +
107110
compileFile("../tests/pos/t2168.scala", defaultOptions) +
@@ -160,6 +163,7 @@ class CompilationTests extends ParallelTesting {
160163
// Negative tests ------------------------------------------------------------
161164

162165
@Test def compileNeg: Unit = {
166+
implicit val testGroup: TestGroup = TestGroup("compileNeg")
163167
compileShallowFilesInDir("../tests/neg", defaultOptions) +
164168
compileShallowFilesInDir("../tests/neg/no-optimise", defaultOptions) +
165169
compileFile("../tests/neg/customArgs/typers.scala", allowDoubleBindings) +
@@ -189,13 +193,15 @@ class CompilationTests extends ParallelTesting {
189193
// Run tests -----------------------------------------------------------------
190194

191195
@Test def runAll: Unit = {
196+
implicit val testGroup: TestGroup = TestGroup("runAll")
192197
compileFilesInDir("../tests/run", defaultOptions) +
193198
compileFilesInDir("../tests/run-no-optimise", defaultOptions)
194199
}.checkRuns()
195200

196201
// Generic java signatures tests ---------------------------------------------
197202

198203
@Test def genericJavaSignatures: Unit = {
204+
implicit val testGroup: TestGroup = TestGroup("genericJavaSignatures")
199205
compileFilesInDir("../tests/generic-java-signatures", defaultOptions)
200206
}.checkRuns()
201207

@@ -205,6 +211,7 @@ class CompilationTests extends ParallelTesting {
205211
// lower level of concurrency as to not kill their running VMs
206212

207213
@Test def testPickling: Unit = {
214+
implicit val testGroup: TestGroup = TestGroup("testPickling")
208215
compileDir("../compiler/src/dotty/tools", picklingOptions) +
209216
compileDir("../compiler/src/dotty/tools/dotc", picklingOptions) +
210217
compileFilesInDir("../tests/new", picklingOptions) +
@@ -233,18 +240,23 @@ class CompilationTests extends ParallelTesting {
233240
* version of Dotty
234241
*/
235242
@Test def tastyBootstrap: Unit = {
243+
implicit val testGroup: TestGroup = TestGroup("tastyBootstrap/tests")
244+
val dotty1Group = TestGroup("tastyBootstrap/dotty1")
245+
val dotty2Group = TestGroup("tastyBootstrap/dotty2")
246+
val libGroup = TestGroup("tastyBootstrap/lib")
247+
236248
val opt = TestFlags(
237249
// compile with bootstrapped library on cp:
238-
defaultOutputDir + "lib/src/:" +
250+
defaultOutputDir + libGroup + "/src/:" +
239251
// as well as bootstrapped compiler:
240-
defaultOutputDir + "dotty1/dotty/:" +
252+
defaultOutputDir + dotty1Group + "/dotty/:" +
241253
Jars.dottyInterfaces,
242254
Array("-Ycheck-reentrant")
243255
)
244256

245-
def lib =
257+
val lib =
246258
compileDir("../library/src",
247-
defaultOptions.and("-Ycheck-reentrant", "-strict", "-priorityclasspath", defaultOutputDir))
259+
defaultOptions.and("-Ycheck-reentrant", "-strict", "-priorityclasspath", defaultOutputDir))(libGroup)
248260

249261
val compilerDir = Paths.get("../compiler/src")
250262
val compilerSources = sources(Files.walk(compilerDir))
@@ -263,19 +275,8 @@ class CompilationTests extends ParallelTesting {
263275
val backendJvmSources =
264276
sources(Files.list(backendJvmDir), excludedFiles = backendJvmExcluded)
265277

266-
def dotty1 = {
267-
compileList(
268-
"dotty",
269-
compilerSources ++ backendSources ++ backendJvmSources,
270-
opt)
271-
}
272-
273-
def dotty2 = {
274-
compileList(
275-
"dotty",
276-
compilerSources ++ backendSources ++ backendJvmSources,
277-
opt)
278-
}
278+
val dotty1 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources, opt)(dotty1Group)
279+
val dotty2 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources, opt)(dotty2Group)
279280

280281
val tests = {
281282
lib.keepOutput :: dotty1.keepOutput :: {
@@ -296,19 +297,20 @@ class CompilationTests extends ParallelTesting {
296297
}.keepOutput :: Nil
297298
}.map(_.checkCompile())
298299

299-
assert(new java.io.File("../out/dotty1/dotty/").exists)
300-
assert(new java.io.File("../out/dotty2/dotty/").exists)
300+
assert(new java.io.File(s"../out/$dotty1Group/dotty/").exists)
301+
assert(new java.io.File(s"../out/$dotty2Group/dotty/").exists)
302+
assert(new java.io.File(s"../out/$libGroup/src/").exists)
301303
compileList("idempotency", List("../tests/idempotency/BootstrapChecker.scala", "../tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns()
302304

303305
tests.foreach(_.delete())
304306
}
305307

306308
@Category(Array(classOf[SlowTests]))
307309
@Test def testOptimised: Unit = {
308-
val outputDir = defaultOutputDir + "optimised/"
309-
compileFilesInDir("../tests/pos", defaultOptimised, outputDir).checkCompile()
310-
compileFilesInDir("../tests/run", defaultOptimised, outputDir).checkRuns()
311-
compileShallowFilesInDir("../tests/neg", defaultOptimised, outputDir).checkExpectedErrors()
310+
implicit val testGroup: TestGroup = TestGroup("optimised/testOptimised")
311+
compileFilesInDir("../tests/pos", defaultOptimised).checkCompile()
312+
compileFilesInDir("../tests/run", defaultOptimised).checkRuns()
313+
compileShallowFilesInDir("../tests/neg", defaultOptimised).checkExpectedErrors()
312314
}
313315

314316
private val (compilerSources, backendSources, backendJvmSources) = {

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.junit.{AfterClass, Test}
1010
import org.junit.experimental.categories.Category
1111

1212
import scala.concurrent.duration._
13-
import vulpix.{ParallelTesting, SummaryReport, SummaryReporting, TestConfiguration}
13+
import vulpix._
1414

1515

1616
class IdempotencyTests extends ParallelTesting {
@@ -27,7 +27,7 @@ class IdempotencyTests extends ParallelTesting {
2727

2828
@Category(Array(classOf[SlowTests]))
2929
@Test def idempotency: Unit = {
30-
30+
implicit val testGroup: TestGroup = TestGroup("idempotency")
3131
val opt = defaultOptions.and("-YemitTasty")
3232

3333
def sourcesFrom(dir: Path) = CompilationTests.sources(Files.walk(dir))
@@ -37,19 +37,17 @@ class IdempotencyTests extends ParallelTesting {
3737
val strawmanSourcesRevSorted = strawmanSourcesSorted.reverse
3838

3939
val posIdempotency = {
40-
def posIdempotency1 = compileFilesInDir("../tests/pos", opt)
41-
def posIdempotency2 = compileFilesInDir("../tests/pos", opt)
42-
posIdempotency1 + posIdempotency2
40+
compileFilesInDir("../tests/pos", opt)(TestGroup("idempotency/posIdempotency1")) +
41+
compileFilesInDir("../tests/pos", opt)(TestGroup("idempotency/posIdempotency2"))
4342
}
4443

4544
val orderIdempotency = {
4645
(for {
4746
testDir <- new JFile("../tests/order-idempotency").listFiles() if testDir.isDirectory
4847
} yield {
4948
val sources = sourcesFrom(testDir.toPath)
50-
def orderIdempotency1 = compileList(testDir.getName, sources, opt)
51-
def orderIdempotency2 = compileList(testDir.getName, sources.reverse, opt)
52-
orderIdempotency1 + orderIdempotency2
49+
compileList(testDir.getName, sources, opt)(TestGroup("idempotency/orderIdempotency1")) +
50+
compileList(testDir.getName, sources.reverse, opt)(TestGroup("idempotency/orderIdempotency2"))
5351
}).reduce(_ + _)
5452
}
5553

@@ -62,7 +60,7 @@ class IdempotencyTests extends ParallelTesting {
6260

6361
def check(name: String) = {
6462
val files = List(s"../tests/idempotency/$name.scala", "../tests/idempotency/IdempotencyCheck.scala")
65-
compileList(name, files, defaultOptions)
63+
compileList(name, files, defaultOptions)(TestGroup("idempotency/check"))
6664
}
6765
val allChecks = {
6866
check("CheckOrderIdempotency") +

compiler/test/dotty/tools/dotc/LinkOptimiseTests.scala renamed to compiler/test/dotty/tools/dotc/LinkTests.scala

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import vulpix._
1212
import scala.concurrent.duration._
1313
import scala.collection.JavaConverters._
1414

15-
class LinkOptimiseTests extends ParallelTesting {
15+
class LinkTests extends ParallelTesting {
1616
import ParallelTesting._
1717
import TestConfiguration._
18-
import LinkOptimiseTests._
18+
import LinkTests._
1919

2020
// Test suite configuration --------------------------------------------------
2121

@@ -26,12 +26,16 @@ class LinkOptimiseTests extends ParallelTesting {
2626
def testFilter = Properties.testsFilter
2727

2828

29-
@Test def linkOptimise: Unit = {
29+
@Test def linkTest: Unit = {
3030
// Setup and compile libraries
31-
def strawmanLibrary =
32-
compileDir("../collection-strawman/collections/src/main", defaultOptions)
33-
def linkCustomLib =
34-
compileDir("../tests/link/custom-lib", defaultOptions)
31+
val strawmanLibGroup = TestGroup("linkTest/strawmanLibrary")
32+
val strawmanLibTestGroup = TestGroup(strawmanLibGroup + "/tests")
33+
34+
val linkCustomLibGroup = TestGroup("linkTest/linkCustomLib")
35+
val linkCustomLibTestGroup = TestGroup(linkCustomLibGroup + "/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 + "/main/")
49+
val customLibClassFlags = mkLinkClassFlags(defaultOutputDir + linkCustomLibGroup + "/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)
52-
def linkCustomLibTest = compileFilesInDir(linkCustomLibDir, customLibClassFlags)
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,16 +78,16 @@ 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
}
8186
}
8287

8388
}
8489

85-
object LinkOptimiseTests {
90+
object LinkTests {
8691
implicit val summaryReport: SummaryReporting = new SummaryReport
8792
@AfterClass def cleanup(): Unit = summaryReport.echoSummary()
8893
}

0 commit comments

Comments
 (0)