Skip to content

Commit ab17787

Browse files
committed
Put idempotency tests in their own category
The vulpix command will not run them anymore.
1 parent 79ce6c0 commit ab17787

File tree

2 files changed

+56
-24
lines changed

2 files changed

+56
-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: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package dotty
2+
package tools
3+
package dotc
4+
5+
import org.junit.{ Test, BeforeClass, AfterClass }
6+
7+
import java.nio.file._
8+
import java.util.stream.{ Stream => JStream }
9+
import scala.collection.JavaConverters._
10+
import scala.util.matching.Regex
11+
import scala.concurrent.duration._
12+
13+
import vulpix.{ ParallelTesting, SummaryReport, SummaryReporting, TestConfiguration }
14+
15+
16+
class IdempotencyTests extends ParallelTesting {
17+
import TestConfiguration._
18+
import IdempotencyTests._
19+
20+
// Test suite configuration --------------------------------------------------
21+
22+
def maxDuration = 30.seconds
23+
def numberOfSlaves = 5
24+
def safeMode = Properties.testsSafeMode
25+
def isInteractive = SummaryReport.isInteractive
26+
def testFilter = Properties.testsFilter
27+
28+
/* TODO: Only run them selectively? */
29+
@Test def bytecodeIdempotency: Unit = {
30+
val opt = defaultOptions.and("-YemitTasty")
31+
32+
def idempotency1() = {
33+
compileDir("../collection-strawman/src/main", opt) +
34+
compileFilesInDir("../tests/pos", opt)
35+
}
36+
def idempotency2() = {
37+
compileDir("../collection-strawman/src/main", opt) +
38+
compileFilesInDir("../tests/pos", opt)
39+
}
40+
41+
val tests = (idempotency1() + idempotency2()).keepOutput.checkCompile()
42+
43+
assert(new java.io.File("../out/idempotency1/").exists)
44+
assert(new java.io.File("../out/idempotency2/").exists)
45+
46+
compileList("idempotency", List("../tests/idempotency/Checker.scala", "../tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns()
47+
48+
tests.delete()
49+
}
50+
51+
}
52+
53+
object IdempotencyTests {
54+
implicit val summaryReport: SummaryReporting = new SummaryReport
55+
@AfterClass def cleanup(): Unit = summaryReport.echoSummary()
56+
}

0 commit comments

Comments
 (0)