aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-13 09:41:12 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-04-13 11:02:29 +0200
commitc9e1bc5b6324d2a896d731eeec32bdd941d1629b (patch)
treee2cd59712f957fb6ba6c16c0df662a323834057a
parent3a9deec8e7a3a093e9b56461650857c4cb7a9d8c (diff)
downloaddotty-c9e1bc5b6324d2a896d731eeec32bdd941d1629b.zip
dotty-c9e1bc5b6324d2a896d731eeec32bdd941d1629b.tar.gz
dotty-c9e1bc5b6324d2a896d731eeec32bdd941d1629b.tar.bz2
Fix #2243: improve failing test output
-rw-r--r--compiler/test/dotty/tools/dotc/CompilationTests.scala4
-rw-r--r--compiler/test/dotty/tools/vulpix/ParallelTesting.scala8
-rw-r--r--compiler/test/dotty/tools/vulpix/SummaryReport.scala2
3 files changed, 8 insertions, 6 deletions
diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala
index fa0c89f..ff50d72 100644
--- a/compiler/test/dotty/tools/dotc/CompilationTests.scala
+++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala
@@ -216,9 +216,9 @@ class CompilationTests extends ParallelTesting {
val opt = Array(
"-classpath",
// compile with bootstrapped library on cp:
- defaultOutputDir + "lib$1/src/:" +
+ defaultOutputDir + "lib/src/:" +
// as well as bootstrapped compiler:
- defaultOutputDir + "dotty1$1/dotty/:" +
+ defaultOutputDir + "dotty1/dotty/:" +
Jars.dottyInterfaces
)
diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
index f434620..1315da3 100644
--- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
+++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala
@@ -265,7 +265,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
private[this] val failedTestSources = mutable.ArrayBuffer.empty[String]
protected final def failTestSource(testSource: TestSource, reason: Option[String] = None) = synchronized {
val extra = reason.map(" with reason: " + _).getOrElse("")
- failedTestSources.append(testSource.title + s" failed (in ${testSource.name})" + extra)
+ failedTestSources.append(testSource.title + s" failed" + extra)
fail()
}
@@ -519,6 +519,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
}
case Failure(output) =>
+ echo(s"Test '${testSource.title}' failed with output:")
echo(output)
failTestSource(testSource)
@@ -1018,6 +1019,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
.getOrElse {
throw new IllegalStateException("Unable to reflectively find calling method")
}
+ .takeWhile(_ != '$')
}
/** Compiles a single file from the string path `f` using the supplied flags */
@@ -1072,7 +1074,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
val targetDir = new JFile(outDir + "/" + sourceDir.getName + "/")
targetDir.mkdirs()
- val target = JointCompilationSource(callingMethod, randomized, flags, targetDir)
+ val target = JointCompilationSource(s"compiling '$f' in test '$callingMethod'", randomized, flags, targetDir)
new CompilationTest(target)
}
@@ -1089,7 +1091,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
targetDir.mkdirs()
assert(targetDir.exists, s"couldn't create target directory: $targetDir")
- val target = JointCompilationSource(callingMethod, files.map(new JFile(_)).toArray, flags, targetDir)
+ val target = JointCompilationSource(s"$testName from $callingMethod", files.map(new JFile(_)).toArray, flags, targetDir)
// Create a CompilationTest and let the user decide whether to execute a pos or a neg test
new CompilationTest(target)
diff --git a/compiler/test/dotty/tools/vulpix/SummaryReport.scala b/compiler/test/dotty/tools/vulpix/SummaryReport.scala
index 8f3047f..efca94b 100644
--- a/compiler/test/dotty/tools/vulpix/SummaryReport.scala
+++ b/compiler/test/dotty/tools/vulpix/SummaryReport.scala
@@ -95,7 +95,7 @@ final class SummaryReport extends SummaryReporting {
startingMessages.foreach(rep.append)
- failedTests.map(x => " " + x).foreach(rep.append)
+ failedTests.map(x => s" $x\n").foreach(rep.append)
// If we're compiling locally, we don't need instructions on how to
// reproduce failures