Skip to content

Commit 28dec7c

Browse files
authored
Merge pull request scala#2993 from dotty-staging/split-idempotency-tests
Put idempotency tests in their own category
2 parents c61a0ce + 4122632 commit 28dec7c

File tree

2 files changed

+52
-24
lines changed

2 files changed

+52
-24
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -293,30 +293,6 @@ class CompilationTests extends ParallelTesting {
293293
tests.foreach(_.delete())
294294
}
295295

296-
/** Add a `z` so that they run last. TODO: Only run them selectively? */
297-
@Test def zBytecodeIdempotency: Unit = {
298-
val opt = defaultOptions.and("-YemitTasty")
299-
300-
def idempotency1() = {
301-
compileDir("../collection-strawman/src/main", opt) +
302-
compileFilesInDir("../tests/pos", opt)
303-
}
304-
def idempotency2() = {
305-
compileDir("../collection-strawman/src/main", opt) +
306-
compileFilesInDir("../tests/pos", opt)
307-
}
308-
309-
val tests = (idempotency1() + idempotency2()).keepOutput.checkCompile()
310-
311-
assert(new java.io.File("../out/idempotency1/").exists)
312-
assert(new java.io.File("../out/idempotency2/").exists)
313-
314-
compileList("idempotency", List("../tests/idempotency/Checker.scala", "../tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns()
315-
316-
tests.delete()
317-
}
318-
319-
320296
private val (compilerSources, backendSources, backendJvmSources) = {
321297
def sources(paths: JStream[Path], excludedFiles: List[String] = Nil): List[String] =
322298
paths.iterator().asScala
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package dotty
2+
package tools
3+
package dotc
4+
5+
import org.junit.{ Test, AfterClass }
6+
7+
import scala.concurrent.duration._
8+
9+
import vulpix.{ ParallelTesting, SummaryReport, SummaryReporting, TestConfiguration }
10+
11+
12+
class IdempotencyTests extends ParallelTesting {
13+
import TestConfiguration._
14+
import IdempotencyTests._
15+
16+
// Test suite configuration --------------------------------------------------
17+
18+
def maxDuration = 30.seconds
19+
def numberOfSlaves = 5
20+
def safeMode = Properties.testsSafeMode
21+
def isInteractive = SummaryReport.isInteractive
22+
def testFilter = Properties.testsFilter
23+
24+
/* TODO: Only run them selectively? */
25+
@Test def bytecodeIdempotency: Unit = {
26+
val opt = defaultOptions.and("-YemitTasty")
27+
28+
def idempotency1() = {
29+
compileDir("../collection-strawman/src/main", opt) +
30+
compileFilesInDir("../tests/pos", opt)
31+
}
32+
def idempotency2() = {
33+
compileDir("../collection-strawman/src/main", opt) +
34+
compileFilesInDir("../tests/pos", opt)
35+
}
36+
37+
val tests = (idempotency1() + idempotency2()).keepOutput.checkCompile()
38+
39+
assert(new java.io.File("../out/idempotency1/").exists)
40+
assert(new java.io.File("../out/idempotency2/").exists)
41+
42+
compileList("idempotency", List("../tests/idempotency/Checker.scala", "../tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns()
43+
44+
tests.delete()
45+
}
46+
47+
}
48+
49+
object IdempotencyTests {
50+
implicit val summaryReport: SummaryReporting = new SummaryReport
51+
@AfterClass def cleanup(): Unit = summaryReport.echoSummary()
52+
}

0 commit comments

Comments
 (0)