diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index 4ba729582403..97f9dd612e92 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -293,30 +293,6 @@ class CompilationTests extends ParallelTesting { tests.foreach(_.delete()) } - /** Add a `z` so that they run last. TODO: Only run them selectively? */ - @Test def zBytecodeIdempotency: Unit = { - val opt = defaultOptions.and("-YemitTasty") - - def idempotency1() = { - compileDir("../collection-strawman/src/main", opt) + - compileFilesInDir("../tests/pos", opt) - } - def idempotency2() = { - compileDir("../collection-strawman/src/main", opt) + - compileFilesInDir("../tests/pos", opt) - } - - val tests = (idempotency1() + idempotency2()).keepOutput.checkCompile() - - assert(new java.io.File("../out/idempotency1/").exists) - assert(new java.io.File("../out/idempotency2/").exists) - - compileList("idempotency", List("../tests/idempotency/Checker.scala", "../tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns() - - tests.delete() - } - - private val (compilerSources, backendSources, backendJvmSources) = { def sources(paths: JStream[Path], excludedFiles: List[String] = Nil): List[String] = paths.iterator().asScala diff --git a/compiler/test/dotty/tools/dotc/IdempotencyTests.scala b/compiler/test/dotty/tools/dotc/IdempotencyTests.scala new file mode 100644 index 000000000000..bb2ad7eb3938 --- /dev/null +++ b/compiler/test/dotty/tools/dotc/IdempotencyTests.scala @@ -0,0 +1,52 @@ +package dotty +package tools +package dotc + +import org.junit.{ Test, AfterClass } + +import scala.concurrent.duration._ + +import vulpix.{ ParallelTesting, SummaryReport, SummaryReporting, TestConfiguration } + + +class IdempotencyTests extends ParallelTesting { + import TestConfiguration._ + import IdempotencyTests._ + + // Test suite configuration -------------------------------------------------- + + def maxDuration = 30.seconds + def numberOfSlaves = 5 + def safeMode = Properties.testsSafeMode + def isInteractive = SummaryReport.isInteractive + def testFilter = Properties.testsFilter + + /* TODO: Only run them selectively? */ + @Test def bytecodeIdempotency: Unit = { + val opt = defaultOptions.and("-YemitTasty") + + def idempotency1() = { + compileDir("../collection-strawman/src/main", opt) + + compileFilesInDir("../tests/pos", opt) + } + def idempotency2() = { + compileDir("../collection-strawman/src/main", opt) + + compileFilesInDir("../tests/pos", opt) + } + + val tests = (idempotency1() + idempotency2()).keepOutput.checkCompile() + + assert(new java.io.File("../out/idempotency1/").exists) + assert(new java.io.File("../out/idempotency2/").exists) + + compileList("idempotency", List("../tests/idempotency/Checker.scala", "../tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns() + + tests.delete() + } + +} + +object IdempotencyTests { + implicit val summaryReport: SummaryReporting = new SummaryReport + @AfterClass def cleanup(): Unit = summaryReport.echoSummary() +}