Skip to content

Put idempotency tests in their own category #2993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 52 additions & 0 deletions compiler/test/dotty/tools/dotc/IdempotencyTests.scala
Original file line number Diff line number Diff line change
@@ -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()
}