Skip to content

Commit 9c92162

Browse files
committed
Vulpix: Remove unused logStackTrace & downstream usages
1 parent 8c1cdc2 commit 9c92162

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

compiler/test/dotty/tools/dotc/reporting/TestReporter.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M
3232
protected final val _consoleReporter = new ConsoleReporter(null, new PrintWriter(_consoleBuf))
3333
final def consoleOutput: String = _consoleBuf.toString
3434

35-
private var _didCrash = false
36-
final def compilerCrashed: Boolean = _didCrash
37-
3835
private var _skip: Boolean = false
3936
final def setSkip(): Unit = _skip = true
4037
final def skipped: Boolean = _skip
@@ -50,14 +47,6 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M
5047
def log(msg: String) =
5148
_messageBuf.append(msg)
5249

53-
def logStackTrace(thrown: Throwable): Unit = {
54-
_didCrash = true
55-
val sw = new java.io.StringWriter
56-
val pw = new java.io.PrintWriter(sw)
57-
thrown.printStackTrace(pw)
58-
log(sw.toString)
59-
}
60-
6150
/** Prints the message with the given position indication. */
6251
def printMessageAndPos(dia: Diagnostic, extra: String)(using Context): Unit = {
6352
val msg = messageAndPos(dia)

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -737,8 +737,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
737737
def showDiagnostics = "-> following the diagnostics:\n" +
738738
reporters.flatMap(_.diagnostics.toSeq.sortBy(_.pos.line).map(e => s"${e.pos.line + 1}: ${e.message}")).mkString(" at ", "\n at ", "")
739739
Option:
740-
if reporters.exists(_.compilerCrashed) then s"Compiler crashed when compiling: ${testSource.title}"
741-
else if reporters.exists(_.errorCount > 0) then
740+
if reporters.exists(_.errorCount > 0) then
742741
s"""Compilation failed for: ${testSource.title}
743742
|$showDiagnostics
744743
|""".stripMargin.trim.linesIterator.mkString("\n", "\n", "")
@@ -862,7 +861,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
862861
override def suppressErrors = true
863862

864863
override def maybeFailureMessage(testSource: TestSource, reporters: Seq[TestReporter]): Option[String] =
865-
def compilerCrashed = reporters.exists(_.compilerCrashed)
866864
lazy val (errorMap, expectedErrors) = getErrorMapAndExpectedCount(testSource.sourceFiles.toIndexedSeq)
867865
lazy val actualErrors = reporters.foldLeft(0)(_ + _.errorCount)
868866
lazy val (expected, unexpected) = getMissingExpectedErrors(errorMap, reporters.iterator.flatMap(_.errors))
@@ -871,8 +869,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
871869
reporters.flatMap(_.allErrors.sortBy(_.pos.line).map(e => s"${e.pos.line + 1}: ${e.message}")).mkString(" at ", "\n at ", "")
872870

873871
Option {
874-
if compilerCrashed then s"Compiler crashed when compiling: ${testSource.title}"
875-
else if actualErrors == 0 then s"\nNo errors found when compiling neg test $testSource"
872+
if actualErrors == 0 then s"\nNo errors found when compiling neg test $testSource"
876873
else if expectedErrors == 0 then s"\nNo errors expected/defined in $testSource -- use // error or // nopos-error"
877874
else if expectedErrors != actualErrors then
878875
s"""|Wrong number of errors encountered when compiling $testSource

0 commit comments

Comments
 (0)