@@ -48,7 +48,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
48
48
/** A test source whose files or directory of files is to be compiled
49
49
* in a specific way defined by the `Test`
50
50
*/
51
- protected sealed trait TestSource { self =>
51
+ private sealed trait TestSource { self =>
52
52
def name : String
53
53
def outDir : JFile
54
54
def flags : TestFlags
@@ -602,20 +602,39 @@ trait ParallelTesting extends RunnerOrchestration { self =>
602
602
if (Properties .testsNoRun) addNoRunWarning()
603
603
else runMain(testSource.runClassPath) match {
604
604
case Success (_) if ! checkFile.isDefined || ! checkFile.get.exists => // success!
605
- case Success (output) =>
606
- checkDiff(output, checkFile.get, testSource, warnings) match {
607
- case Some (msg) =>
608
- echo(msg)
609
- addFailureInstruction(msg)
610
-
611
- // Print build instructions to file and summary:
612
- val buildInstr = testSource.buildInstructions(0 , warnings)
613
- addFailureInstruction(buildInstr)
614
-
615
- // Fail target:
616
- failTestSource(testSource)
617
- case None =>
605
+ case Success (output) => {
606
+ val outputLines = output.lines.toArray :+ DiffUtil .EOF
607
+ val checkLines : Array [String ] = Source .fromFile(checkFile.get).getLines().toArray :+ DiffUtil .EOF
608
+ val sourceTitle = testSource.title
609
+
610
+ def linesMatch =
611
+ outputLines
612
+ .zip(checkLines)
613
+ .forall { case (x, y) => x == y }
614
+
615
+ if (outputLines.length != checkLines.length || ! linesMatch) {
616
+ // Print diff to files and summary:
617
+ val expectedSize = DiffUtil .EOF .length max checkLines.map(_.length).max
618
+ val diff = outputLines.padTo(checkLines.length, " " ).zip(checkLines.padTo(outputLines.length, " " )).map { case (act, exp) =>
619
+ DiffUtil .mkColoredLineDiff(exp, act, expectedSize)
620
+ }.mkString(" \n " )
621
+
622
+ val msg =
623
+ s """ |Output from ' $sourceTitle' did not match check file.
624
+ |Diff (expected on the left, actual right):
625
+ | """ .stripMargin + diff + " \n "
626
+ echo(msg)
627
+ addFailureInstruction(msg)
628
+
629
+ // Print build instructions to file and summary:
630
+ val buildInstr = testSource.buildInstructions(0 , warnings)
631
+ addFailureInstruction(buildInstr)
632
+
633
+ // Fail target:
634
+ failTestSource(testSource)
618
635
}
636
+ }
637
+
619
638
case Failure (output) =>
620
639
echo(s " Test ' ${testSource.title}' failed with output: " )
621
640
echo(output)
@@ -793,31 +812,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
793
812
}
794
813
}
795
814
796
- private def checkDiff (output : String , checkFile : JFile , testSource : TestSource , warnings : Int ): Option [String ] = {
797
- val outputLines = output.lines.toArray :+ DiffUtil .EOF
798
- val checkLines : Array [String ] = Source .fromFile(checkFile).getLines().toArray :+ DiffUtil .EOF
799
- val sourceTitle = testSource.title
800
-
801
- def linesMatch =
802
- outputLines
803
- .zip(checkLines)
804
- .forall { case (x, y) => x == y }
805
-
806
- if (outputLines.length != checkLines.length || ! linesMatch) {
807
- // Print diff to files and summary:
808
- val expectedSize = DiffUtil .EOF .length max checkLines.map(_.length).max
809
- val diff = outputLines.padTo(checkLines.length, " " ).zip(checkLines.padTo(outputLines.length, " " )).map { case (act, exp) =>
810
- DiffUtil .mkColoredLineDiff(exp, act, expectedSize)
811
- }.mkString(" \n " )
812
-
813
- val msg =
814
- s """ |Output from ' $sourceTitle' did not match check file.
815
- |Diff (expected on the left, actual right):
816
- | """ .stripMargin + diff + " \n "
817
- Some (msg)
818
- } else None
819
- }
820
-
821
815
/** The `CompilationTest` is the main interface to `ParallelTesting`, it
822
816
* can be instantiated via one of the following methods:
823
817
*
0 commit comments