diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-04-13 11:30:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 11:30:24 +0200 |
commit | 46e3395693b6f8749aa0b01b41b7d643f3bef5dc (patch) | |
tree | d24e149dd111287c80fb35026faafd2cbef5f526 /compiler/test/dotty/tools/vulpix/ParallelTesting.scala | |
parent | d1cbf5fd02ecb7a9531a90014881ad2f416af4fb (diff) | |
parent | 3a15365ab25b6ba0fda2c4321b47f9b257dc5aef (diff) | |
download | dotty-46e3395693b6f8749aa0b01b41b7d643f3bef5dc.tar.gz dotty-46e3395693b6f8749aa0b01b41b7d643f3bef5dc.tar.bz2 dotty-46e3395693b6f8749aa0b01b41b7d643f3bef5dc.zip |
Merge pull request #2248 from dotty-staging/topic/vulpix-fixes1
Various vulpix fixes
Diffstat (limited to 'compiler/test/dotty/tools/vulpix/ParallelTesting.scala')
-rw-r--r-- | compiler/test/dotty/tools/vulpix/ParallelTesting.scala | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala index f43462011..b0312523d 100644 --- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala +++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala @@ -192,8 +192,6 @@ trait ParallelTesting extends RunnerOrchestration { self => /** A runnable that logs its contents in a buffer */ trait LoggedRunnable extends Runnable { - import TestReporter.logWriter - /** Instances of `LoggedRunnable` implement this method instead of the * `run` method */ @@ -212,8 +210,7 @@ trait ParallelTesting extends RunnerOrchestration { self => final def run(): Unit = { checkTestSource() - logBuffer.iterator.foreach(logWriter.println) - logWriter.flush() + summaryReport.echoToLog(logBuffer.iterator) } } @@ -265,7 +262,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() } @@ -309,7 +306,7 @@ trait ParallelTesting extends RunnerOrchestration { self => protected def tryCompile(testSource: TestSource)(op: => Unit): Unit = try { val testing = s"Testing ${testSource.title}" - TestReporter.logWriter.println(testing) + summaryReport.echoToLog(testing) if (!isInteractive) realStdout.println(testing) op } catch { @@ -519,6 +516,7 @@ trait ParallelTesting extends RunnerOrchestration { self => } case Failure(output) => + echo(s"Test '${testSource.title}' failed with output:") echo(output) failTestSource(testSource) @@ -574,7 +572,7 @@ trait ParallelTesting extends RunnerOrchestration { self => if (!compilerCrashed && errorCount == 0) verifier() else { - echo(s"\n Compilation failed for: '$testSource'") + echo(s" Compilation failed for: '${testSource.title}' ") val buildInstr = testSource.buildInstructions(errorCount, warningCount) addFailureInstruction(buildInstr) failTestSource(testSource) @@ -1018,6 +1016,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 +1071,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 +1088,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) |