aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-07 14:46:17 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-04-12 11:31:15 +0200
commitd42a28d07683d95e6dffd27cdb9078ebeb599c15 (patch)
tree3907a8a0d59a99b23f3ce483cb5006c137373eba /compiler/test/dotty/tools/vulpix/ParallelTesting.scala
parent55803b2657a473a1ebbebfd9ab7ba4c1b4e27d38 (diff)
downloaddotty-d42a28d07683d95e6dffd27cdb9078ebeb599c15.tar.gz
dotty-d42a28d07683d95e6dffd27cdb9078ebeb599c15.tar.bz2
dotty-d42a28d07683d95e6dffd27cdb9078ebeb599c15.zip
Add ability to only compile run tests
Diffstat (limited to 'compiler/test/dotty/tools/vulpix/ParallelTesting.scala')
-rw-r--r--compiler/test/dotty/tools/vulpix/ParallelTesting.scala38
1 files changed, 27 insertions, 11 deletions
diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
index 8cafd543b..e1babfb9c 100644
--- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
+++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
@@ -426,8 +426,21 @@ trait ParallelTesting extends RunnerOrchestration { self =>
private final class RunTest(testSources: List[TestSource], times: Int, threadLimit: Option[Int], suppressAllOutput: Boolean)
extends Test(testSources, times, threadLimit, suppressAllOutput) {
+ private[this] var didAddNoRunWarning = false
+ private[this] def addNoRunWarning() = if (!didAddNoRunWarning) {
+ didAddNoRunWarning = true
+ SummaryReport.addStartingMessage {
+ """|WARNING
+ |-------
+ |Run tests were only compiled, not run - this is due to `dotty.tests.norun`
+ |property being set
+ |""".stripMargin
+ }
+ }
+
private def verifyOutput(checkFile: JFile, dir: JFile, testSource: TestSource, warnings: Int) = {
- runMain(testSource.classPath) match {
+ if (Properties.testsNoRun) addNoRunWarning()
+ else runMain(testSource.classPath) match {
case Success(output) => {
val outputLines = output.lines.toArray
val checkLines: Array[String] = Source.fromFile(checkFile).getLines.toArray
@@ -511,16 +524,19 @@ trait ParallelTesting extends RunnerOrchestration { self =>
}
if (errorCount == 0 && hasCheckFile) verifier()
- else if (errorCount == 0) runMain(testSource.classPath) match {
- case Success(_) => // success!
- case Failure(output) =>
- echo(s" failed when running '${testSource.title}'")
- echo(output)
- failTestSource(testSource)
- case Timeout =>
- echo(" failed because test " + testSource.title + " timed out")
- failTestSource(testSource, Some("test timed out"))
- }
+ else if (errorCount == 0) {
+ if (Properties.testsNoRun) addNoRunWarning()
+ else runMain(testSource.classPath) match {
+ case Success(_) => // success!
+ case Failure(output) =>
+ echo(s" failed when running '${testSource.title}'")
+ echo(output)
+ failTestSource(testSource)
+ case Timeout =>
+ echo(" failed because test " + testSource.title + " timed out")
+ failTestSource(testSource, Some("test timed out"))
+ }
+ }
else if (errorCount > 0) {
echo(s"\n Compilation failed for: '$testSource'")
val buildInstr = testSource.buildInstructions(errorCount, warningCount)