@@ -281,10 +281,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
281
281
private final def onComplete (testSource : TestSource , reportersOrCrash : Try [Seq [TestReporter ]], logger : LoggedRunnable ): Unit =
282
282
reportersOrCrash match {
283
283
case TryFailure (exn) => onFailure(testSource, Nil , logger, Some (s " Fatal compiler crash when compiling: ${testSource.title}: \n ${exn.getMessage}${exn.getStackTrace.map(" \n\t at " + _).mkString}" ))
284
- case TrySuccess (reporters) => maybeFailureMessage(testSource, reporters) match {
285
- case Some (msg) => onFailure(testSource, reporters, logger, Option (msg).filter(_.nonEmpty))
286
- case None => onSuccess(testSource, reporters, logger)
287
- }
284
+ case TrySuccess (reporters) if ! reporters.exists(_.skipped) =>
285
+ maybeFailureMessage(testSource, reporters) match {
286
+ case Some (msg) => onFailure(testSource, reporters, logger, Option (msg).filter(_.nonEmpty))
287
+ case None => onSuccess(testSource, reporters, logger)
288
+ }
289
+ case _ =>
288
290
}
289
291
290
292
/**
@@ -392,9 +394,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
392
394
def failureCount : Int = _failureCount
393
395
394
396
private var _skipCount = 0
395
- protected final def skip (): Unit = synchronized { _skipCount += 1 }
397
+ protected final def registerSkip (): Unit = synchronized { _skipCount += 1 }
396
398
def skipCount : Int = _skipCount
397
- def skipped : Boolean = skipCount > 0
398
399
399
400
protected def logBuildInstructions (testSource : TestSource , reporters : Seq [TestReporter ]) = {
400
401
val (errCount, warnCount) = countErrorsAndWarnings(reporters)
@@ -529,7 +530,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
529
530
fail(failure = JavaCompilationFailure (javaErrors.get))
530
531
}
531
532
else
532
- skip()
533
+ registerSkip()
534
+ reporter.setSkip()
533
535
end if
534
536
535
537
reporter
@@ -731,8 +733,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
731
733
}
732
734
733
735
private def verifyOutput (checkFile : Option [JFile ], dir : JFile , testSource : TestSource , warnings : Int , reporters : Seq [TestReporter ], logger : LoggedRunnable ) = {
734
- if skipped then ()
735
- else if Properties .testsNoRun then addNoRunWarning()
736
+ if Properties .testsNoRun then addNoRunWarning()
736
737
else runMain(testSource.runClassPath, testSource.allToolArgs) match {
737
738
case Success (output) => checkFile match {
738
739
case Some (file) if file.exists => diffTest(testSource, file, output.linesIterator.toList, reporters, logger)
@@ -756,7 +757,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
756
757
extends Test (testSources, times, threadLimit, suppressAllOutput) {
757
758
override def suppressErrors = true
758
759
759
- override def maybeFailureMessage (testSource : TestSource , reporters : Seq [TestReporter ]): Option [String ] = if skipped then None else
760
+ override def maybeFailureMessage (testSource : TestSource , reporters : Seq [TestReporter ]): Option [String ] =
760
761
def compilerCrashed = reporters.exists(_.compilerCrashed)
761
762
lazy val (errorMap, expectedErrors) = getErrorMapAndExpectedCount(testSource.sourceFiles.toIndexedSeq)
762
763
lazy val actualErrors = reporters.foldLeft(0 )(_ + _.errorCount)
@@ -997,7 +998,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
997
998
if (! shouldFail && test.didFail) {
998
999
fail(s " Expected no errors when compiling, failed for the following reason(s): \n ${reasonsForFailure(test)}\n " )
999
1000
}
1000
- else if (shouldFail && ! test.didFail) {
1001
+ else if (shouldFail && ! test.didFail && test.skipCount == 0 ) {
1001
1002
fail(" Pos test should have failed, but didn't" )
1002
1003
}
1003
1004
@@ -1013,12 +1014,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
1013
1014
1014
1015
cleanup()
1015
1016
1016
- if ! test.skipped then
1017
- if shouldFail && ! test.didFail then
1018
- fail(s " Neg test shouldn't have failed, but did. Reasons: \n ${ reasonsForFailure(test) }" )
1019
- else if ! shouldFail && test.didFail then
1020
- fail(" Neg test should have failed, but did not" )
1021
- end if
1017
+ if shouldFail && ! test.didFail && test.skipCount == 0 then
1018
+ fail(s " Neg test shouldn't have failed, but did. Reasons: \n ${ reasonsForFailure(test) }" )
1019
+ else if ! shouldFail && test.didFail then
1020
+ fail(" Neg test should have failed, but did not" )
1022
1021
1023
1022
this
1024
1023
end checkExpectedErrors
@@ -1046,12 +1045,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
1046
1045
1047
1046
cleanup()
1048
1047
1049
- if ! test.skipped then
1050
- if ! shouldFail && test.didFail then
1051
- fail(s " Run test failed, but should not, reasons: \n ${ reasonsForFailure(test) }" )
1052
- else if shouldFail && ! test.didFail then
1053
- fail(" Run test should have failed, but did not" )
1054
- end if
1048
+ if ! shouldFail && test.didFail then
1049
+ fail(s " Run test failed, but should not, reasons: \n ${ reasonsForFailure(test) }" )
1050
+ else if shouldFail && ! test.didFail && test.skipCount == 0 then
1051
+ fail(" Run test should have failed, but did not" )
1055
1052
1056
1053
this
1057
1054
}
0 commit comments