@@ -225,11 +225,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
225
225
* Checks if the given actual lines are the same as the ones in the check file.
226
226
* If not, fails the test.
227
227
*/
228
- final def diffTest (testSource : TestSource , checkFile : JFile , actual : List [String ]) = {
228
+ final def diffTest (testSource : TestSource , checkFile : JFile , actual : List [String ], reporters : Seq [ TestReporter ], logger : LoggedRunnable ) = {
229
229
val expected = Source .fromFile(checkFile, " UTF-8" ).getLines().toList
230
230
for (msg <- diffMessage(testSource.title, actual, expected)) {
231
- echo(msg)
232
- failTestSource(testSource)
231
+ onFailure(testSource, reporters, logger, Some (msg))
233
232
dumpOutputToFile(checkFile, actual)
234
233
}
235
234
}
@@ -609,11 +608,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
609
608
}
610
609
}
611
610
612
- private def verifyOutput (checkFile : Option [JFile ], dir : JFile , testSource : TestSource , warnings : Int ) = {
611
+ private def verifyOutput (checkFile : Option [JFile ], dir : JFile , testSource : TestSource , warnings : Int , reporters : Seq [ TestReporter ], logger : LoggedRunnable ) = {
613
612
if (Properties .testsNoRun) addNoRunWarning()
614
613
else runMain(testSource.runClassPath) match {
615
614
case Success (output) => checkFile match {
616
- case Some (file) if file.exists => diffTest(testSource, file, output.linesIterator.toList)
615
+ case Some (file) if file.exists => diffTest(testSource, file, output.linesIterator.toList, reporters, logger )
617
616
case _ =>
618
617
}
619
618
case Failure (output) =>
@@ -627,7 +626,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
627
626
}
628
627
629
628
override def onSuccess (testSource : TestSource , reporters : Seq [TestReporter ], logger : LoggedRunnable ) =
630
- verifyOutput(checkFile(testSource), testSource.outDir, testSource, countWarnings(reporters))
629
+ verifyOutput(checkFile(testSource), testSource.outDir, testSource, countWarnings(reporters), reporters, logger )
631
630
}
632
631
633
632
private final class NegTest (testSources : List [TestSource ], times : Int , threadLimit : Option [Int ], suppressAllOutput : Boolean )(implicit summaryReport : SummaryReporting )
@@ -649,7 +648,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
649
648
}
650
649
651
650
override def onSuccess (testSource : TestSource , reporters : Seq [TestReporter ], logger : LoggedRunnable ): Unit =
652
- checkFile(testSource).foreach(diffTest(testSource, _, reporterOutputLines(reporters)))
651
+ checkFile(testSource).foreach(diffTest(testSource, _, reporterOutputLines(reporters), reporters, logger ))
653
652
654
653
def reporterOutputLines (reporters : Seq [TestReporter ]): List [String ] =
655
654
reporters.flatMap(_.errors).sortBy(_._1.pos.source.toString).map(_._2).toList
0 commit comments