@@ -193,8 +193,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
193
193
testSource.compilationGroups.map(files => compile(files, flags, false , outDir)) // TODO? only `compile` option?
194
194
}
195
195
196
- def onSuccess (testSource : TestSource , reporters : Seq [TestReporter ]): Unit = ()
197
- def onFailure (testSource : TestSource , reporters : Seq [TestReporter ]): Unit = ()
196
+ def onSuccess (testSource : TestSource , reporters : Seq [TestReporter ], logger : LoggedRunnable ): Unit = ()
197
+ def onFailure (testSource : TestSource , reporters : Seq [TestReporter ], logger : LoggedRunnable ): Unit = {
198
+ echo(s " Compilation failed for: ' ${testSource.title}' " )
199
+ reporters.filter(reporterFailed).foreach(logger.logReporterContents)
200
+ logBuildInstructions(testSource, reporters)
201
+ }
198
202
199
203
def countErrorsAndWarnings (reporters : Seq [TestReporter ]): (Int , Int ) =
200
204
reporters.foldLeft((0 , 0 )) { case ((err, warn), r) => (err + r.errorCount, warn + r.warningCount) }
@@ -203,17 +207,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
203
207
def countWarnings (reporters : Seq [TestReporter ]) = countErrorsAndWarnings(reporters)._2
204
208
def reporterFailed (r : TestReporter ) = r.compilerCrashed || r.errorCount > 0
205
209
206
- protected def encapsulatedCompilation (testSource : TestSource ) = new LoggedRunnable {
210
+ protected def encapsulatedCompilation (testSource : TestSource ) = new LoggedRunnable { self =>
207
211
def checkTestSource (): Unit = tryCompile(testSource) {
208
212
val reporters = compileTestSource(testSource)
209
-
210
- if (! reporters.exists(reporterFailed)) onSuccess(testSource, reporters)
211
- else { onFailure(testSource, reporters)
212
- echo(s " Compilation failed for: ' ${testSource.title}' " )
213
- reporters.filter(reporterFailed).foreach(logReporterContents)
214
- logBuildInstructions(testSource, reporters)
215
- }
216
- registerCompletion()
213
+ if (! reporters.exists(reporterFailed)) onSuccess(testSource, reporters, self)
214
+ else onFailure(testSource, reporters, self)
217
215
}
218
216
}
219
217
}
@@ -641,7 +639,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
641
639
}
642
640
643
641
644
- override def onSuccess (testSource : TestSource , reporters : Seq [TestReporter ]) =
642
+ override def onSuccess (testSource : TestSource , reporters : Seq [TestReporter ], logger : LoggedRunnable ) =
645
643
verifyOutput(checkFile(testSource), testSource.outDir, testSource, countWarnings(reporters))
646
644
}
647
645
0 commit comments