@@ -482,12 +482,13 @@ trait ParallelTesting extends RunnerOrchestration { self =>
482
482
}
483
483
}
484
484
485
- private def verifyOutput (checkFile : JFile , dir : JFile , testSource : TestSource , warnings : Int ) = {
485
+ private def verifyOutput (checkFile : Option [ JFile ] , dir : JFile , testSource : TestSource , warnings : Int ) = {
486
486
if (Properties .testsNoRun) addNoRunWarning()
487
487
else runMain(testSource.classPath) match {
488
+ case Success (_) if ! checkFile.isDefined || ! checkFile.get.exists => // success!
488
489
case Success (output) => {
489
490
val outputLines = output.lines.toArray
490
- val checkLines : Array [String ] = Source .fromFile(checkFile).getLines.toArray
491
+ val checkLines : Array [String ] = Source .fromFile(checkFile.get ).getLines.toArray
491
492
val sourceTitle = testSource.title
492
493
493
494
def linesMatch =
@@ -529,7 +530,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
529
530
530
531
protected def encapsulatedCompilation (testSource : TestSource ) = new LoggedRunnable {
531
532
def checkTestSource (): Unit = tryCompile(testSource) {
532
- val (compilerCrashed, errorCount, warningCount, hasCheckFile, verifier : Function0 [Unit ]) = testSource match {
533
+ val (compilerCrashed, errorCount, warningCount, verifier : Function0 [Unit ]) = testSource match {
533
534
case testSource @ JointCompilationSource (_, files, flags, outDir) => {
534
535
val checkFile = files.flatMap { file =>
535
536
if (file.isDirectory) Nil
@@ -547,7 +548,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
547
548
logBuildInstructions(reporter, testSource, reporter.errorCount, reporter.warningCount)
548
549
}
549
550
550
- (reporter.compilerCrashed, reporter.errorCount, reporter.warningCount, checkFile.isDefined, () => verifyOutput(checkFile.get , outDir, testSource, reporter.warningCount))
551
+ (reporter.compilerCrashed, reporter.errorCount, reporter.warningCount, () => verifyOutput(checkFile, outDir, testSource, reporter.warningCount))
551
552
}
552
553
553
554
case testSource @ SeparateCompilationSource (_, dir, flags, outDir) => {
@@ -567,24 +568,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
567
568
logBuildInstructions(reporters.head, testSource, errorCount, warningCount)
568
569
}
569
570
570
- (compilerCrashed, errorCount, warningCount, checkFile.exists, () => verifyOutput(checkFile, outDir, testSource, warningCount))
571
+ (compilerCrashed, errorCount, warningCount, () => verifyOutput(Some ( checkFile) , outDir, testSource, warningCount))
571
572
}
572
573
}
573
574
574
- if (! compilerCrashed && errorCount == 0 && hasCheckFile) verifier()
575
- else if (! compilerCrashed && errorCount == 0 ) {
576
- if (Properties .testsNoRun) addNoRunWarning()
577
- else runMain(testSource.classPath) match {
578
- case Success (_) => // success!
579
- case Failure (output) =>
580
- echo(s " failed when running ' ${testSource.title}' " )
581
- echo(output)
582
- failTestSource(testSource)
583
- case Timeout =>
584
- echo(" failed because test " + testSource.title + " timed out" )
585
- failTestSource(testSource, Some (" test timed out" ))
586
- }
587
- }
575
+ if (! compilerCrashed && errorCount == 0 ) verifier()
588
576
else {
589
577
echo(s " \n Compilation failed for: ' $testSource' " )
590
578
val buildInstr = testSource.buildInstructions(errorCount, warningCount)
0 commit comments