@@ -244,7 +244,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
244244
245245 final def countErrors (reporters : Seq [TestReporter ]) = countErrorsAndWarnings(reporters)._1
246246 final def countWarnings (reporters : Seq [TestReporter ]) = countErrorsAndWarnings(reporters)._2
247- final def reporterFailed (r : TestReporter ) = r.compilerCrashed || r. errorCount > 0
247+ final def reporterFailed (r : TestReporter ) = r.errorCount > 0
248248
249249 /**
250250 * For a given test source, returns a check file against which the result of the test run
@@ -733,22 +733,20 @@ trait ParallelTesting extends RunnerOrchestration { self =>
733733 lazy val (map, expCount) = getWarnMapAndExpectedCount(testSource.sourceFiles.toIndexedSeq)
734734 lazy val obtCount = reporters.foldLeft(0 )(_ + _.warningCount)
735735 lazy val (expected, unexpected) = getMissingExpectedWarnings(map, reporters.iterator.flatMap(_.diagnostics))
736+ lazy val diagnostics = reporters.flatMap(_.diagnostics.toSeq.sortBy(_.pos.line).map(e => s " at ${e.pos.line + 1 }: ${e.message}" ))
737+ def showLines (title : String , lines : Seq [String ]) = if lines.isEmpty then " " else title + lines.mkString(" \n " , " \n " , " " )
736738 def hasMissingAnnotations = expected.nonEmpty || unexpected.nonEmpty
737- def showDiagnostics = " -> following the diagnostics:\n " +
738- reporters.flatMap(_.diagnostics.toSeq.sortBy(_.pos.line).map(e => s " ${e.pos.line + 1 }: ${e.message}" )).mkString(" at " , " \n at " , " " )
739+ def showDiagnostics = showLines(" -> following the diagnostics:" , diagnostics)
739740 Option :
740- if reporters.exists(_.compilerCrashed) then s " Compiler crashed when compiling: ${testSource.title}"
741- else if reporters.exists(_.errorCount > 0 ) then
741+ if reporters.exists(_.errorCount > 0 ) then
742742 s """ Compilation failed for: ${testSource.title}
743743 | $showDiagnostics
744744 | """ .stripMargin.trim.linesIterator.mkString(" \n " , " \n " , " " )
745- else if obtCount == 0 then s " \n No warnings found when compiling warn test $testSource"
746- else if expCount == 0 then s " \n No warning expected/defined in $testSource -- use // warn "
747745 else if expCount != obtCount then
748746 s """ |Wrong number of warnings encountered when compiling $testSource
749747 |expected: $expCount, actual: $obtCount
750- | ${expected.mkString (" Unfulfilled expectations:\n " , " \n " , " " )}
751- | ${unexpected.mkString (" Unexpected warnings:\n " , " \n " , " " )}
748+ | ${showLines (" Unfulfilled expectations:" , expected )}
749+ | ${showLines (" Unexpected warnings:" , unexpected )}
752750 | $showDiagnostics
753751 | """ .stripMargin.trim.linesIterator.mkString(" \n " , " \n " , " " )
754752 else if hasMissingAnnotations then s " \n Warnings found on incorrect row numbers when compiling $testSource\n $showDiagnostics"
@@ -862,7 +860,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
862860 override def suppressErrors = true
863861
864862 override def maybeFailureMessage (testSource : TestSource , reporters : Seq [TestReporter ]): Option [String ] =
865- def compilerCrashed = reporters.exists(_.compilerCrashed)
866863 lazy val (errorMap, expectedErrors) = getErrorMapAndExpectedCount(testSource.sourceFiles.toIndexedSeq)
867864 lazy val actualErrors = reporters.foldLeft(0 )(_ + _.errorCount)
868865 lazy val (expected, unexpected) = getMissingExpectedErrors(errorMap, reporters.iterator.flatMap(_.errors))
@@ -871,8 +868,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
871868 reporters.flatMap(_.allErrors.sortBy(_.pos.line).map(e => s " ${e.pos.line + 1 }: ${e.message}" )).mkString(" at " , " \n at " , " " )
872869
873870 Option {
874- if compilerCrashed then s " Compiler crashed when compiling: ${testSource.title}"
875- else if actualErrors == 0 then s " \n No errors found when compiling neg test $testSource"
871+ if actualErrors == 0 then s " \n No errors found when compiling neg test $testSource"
876872 else if expectedErrors == 0 then s " \n No errors expected/defined in $testSource -- use // error or // nopos-error "
877873 else if expectedErrors != actualErrors then
878874 s """ |Wrong number of errors encountered when compiling $testSource
0 commit comments