aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/dotc/ParallelTesting.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-03-31 11:49:43 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-03-31 11:55:16 +0200
commit57a11776480ab5259281dd29777c45af9ea3ca78 (patch)
treeaf84e7eca37779ef164964840bc6a6e8e9313356 /compiler/test/dotty/tools/dotc/ParallelTesting.scala
parent6d7c23016ec866de0b29e9bdde00b60c99df90c2 (diff)
downloaddotty-57a11776480ab5259281dd29777c45af9ea3ca78.tar.gz
dotty-57a11776480ab5259281dd29777c45af9ea3ca78.tar.bz2
dotty-57a11776480ab5259281dd29777c45af9ea3ca78.zip
Improve summary report by dumping all to stdout on CI
Diffstat (limited to 'compiler/test/dotty/tools/dotc/ParallelTesting.scala')
-rw-r--r--compiler/test/dotty/tools/dotc/ParallelTesting.scala23
1 files changed, 21 insertions, 2 deletions
diff --git a/compiler/test/dotty/tools/dotc/ParallelTesting.scala b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
index 8e87c1170..990a856ca 100644
--- a/compiler/test/dotty/tools/dotc/ParallelTesting.scala
+++ b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
@@ -51,6 +51,16 @@ trait ParallelTesting { self =>
def outDir: JFile
def flags: Array[String]
+
+ def title: String = self match {
+ case self: JointCompilationSource =>
+ if (self.files.length > 1) name
+ else self.files.head.getPath
+
+ case self: SeparateCompilationSource =>
+ self.dir.getPath
+ }
+
/** Adds the flags specified in `newFlags0` if they do not already exist */
def withFlags(newFlags0: String*) = {
val newFlags = newFlags0.toArray
@@ -69,7 +79,11 @@ trait ParallelTesting { self =>
val maxLen = 80
var lineLen = 0
- sb.append(s"\n\nTest compiled with $errors error(s) and $warnings warning(s), the test can be reproduced by running:")
+ sb.append(
+ s"""|
+ |Test '$title' compiled with $errors error(s) and $warnings warning(s),
+ |the test can be reproduced by running:""".stripMargin
+ )
sb.append("\n\n./bin/dotc ")
flags.foreach { arg =>
if (lineLen > maxLen) {
@@ -447,6 +461,7 @@ trait ParallelTesting { self =>
private def verifyOutput(checkFile: JFile, dir: JFile, testSource: TestSource, warnings: Int) = {
val outputLines = runMain(dir, testSource)
val checkLines = Source.fromFile(checkFile).getLines.toArray
+ val sourceTitle = testSource.title
def linesMatch =
outputLines
@@ -458,7 +473,11 @@ trait ParallelTesting { self =>
val diff = outputLines.zip(checkLines).map { case (act, exp) =>
DiffUtil.mkColoredLineDiff(exp, act)
}.mkString("\n")
- val msg = s"\nOutput from run test '$checkFile' did not match expected, output:\n$diff\n"
+
+ val msg =
+ s"""|Output from '$sourceTitle' did not match check file.
+ |Diff ('e' is expected, 'a' is actual):
+ |""".stripMargin + diff + "\n"
echo(msg)
addFailureInstruction(msg)