@@ -765,10 +765,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
765
765
}
766
766
}
767
767
def checkFileTest (sourceName : String , checkFile : JFile , actual : List [String ]) = {
768
- if (checkFile.exists) {
769
- val expexted = Source .fromFile(checkFile, " UTF-8" ).getLines().toList
770
- diffMessage(sourceName, actual, expexted).foreach(fail)
771
- }
768
+ val expexted = Source .fromFile(checkFile, " UTF-8" ).getLines().toList
769
+ diffMessage(sourceName, actual, expexted).foreach(fail)
772
770
}
773
771
774
772
val (compilerCrashed, expectedErrors, actualErrors, hasMissingAnnotations, errorMap) = testSource match {
@@ -778,10 +776,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
778
776
val reporter = compile(sourceFiles, flags, true , outDir)
779
777
val actualErrors = reporter.errorCount
780
778
files.foreach { file =>
781
- if (file.isDirectory) Nil
782
- else {
783
- val checkFile = new JFile (file.getAbsolutePath.reverse.dropWhile(_ != '.' ).reverse + " check " )
784
- checkFileTest(testSource.title, checkFile, reporterOutputLines(reporter))
779
+ if (! file.isDirectory) {
780
+ val checkFile = new JFile (file.getAbsolutePath.replaceFirst( " \\ .scala$ " , " .check " ))
781
+ if (checkFile.exists )
782
+ checkFileTest(testSource.title, checkFile, reporterOutputLines(reporter))
785
783
}
786
784
}
787
785
if (reporter.compilerCrashed || actualErrors > 0 )
@@ -800,8 +798,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
800
798
if (actualErrors > 0 )
801
799
reporters.foreach(logReporterContents)
802
800
803
- val checkFile = new JFile (dir.getAbsolutePath.reverse.dropWhile(_ == JFile .separatorChar).reverse + " .check" )
804
- checkFileTest(testSource.title, checkFile, reporters.flatMap(reporter => reporterOutputLines(reporter)))
801
+ val checkFile = new JFile (dir.getAbsolutePath + " .check" )
802
+ if (checkFile.exists)
803
+ checkFileTest(testSource.title, checkFile, reporters.flatMap(reporter => reporterOutputLines(reporter)))
805
804
806
805
(compilerCrashed, expectedErrors, actualErrors, () => getMissingExpectedErrors(errorMap, errors), errorMap)
807
806
}
0 commit comments