aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/vulpix/SummaryReport.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/test/dotty/tools/vulpix/SummaryReport.scala')
-rw-r--r--compiler/test/dotty/tools/vulpix/SummaryReport.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/test/dotty/tools/vulpix/SummaryReport.scala b/compiler/test/dotty/tools/vulpix/SummaryReport.scala
index 81da634f7..678d88809 100644
--- a/compiler/test/dotty/tools/vulpix/SummaryReport.scala
+++ b/compiler/test/dotty/tools/vulpix/SummaryReport.scala
@@ -34,6 +34,12 @@ trait SummaryReporting {
/** Echo the summary report to the appropriate locations */
def echoSummary(): Unit
+
+ /** Echoes *immediately* to file */
+ def echoToLog(msg: String): Unit
+
+ /** Echoes contents of `it` to file *immediately* then flushes */
+ def echoToLog(it: Iterator[String]): Unit
}
/** A summary report that doesn't do anything */
@@ -45,6 +51,8 @@ final class NoSummaryReport extends SummaryReporting {
def addStartingMessage(msg: String): Unit = ()
def addCleanup(f: () => Unit): Unit = ()
def echoSummary(): Unit = ()
+ def echoToLog(msg: String): Unit = ()
+ def echoToLog(it: Iterator[String]): Unit = ()
}
/** A summary report that logs to both stdout and the `TestReporter.logWriter`
@@ -122,6 +130,14 @@ final class SummaryReport extends SummaryReporting {
// Perform cleanup callback:
if (cleanUps.nonEmpty) cleanUps.foreach(_.apply())
}
+
+ def echoToLog(msg: String): Unit =
+ TestReporter.logPrintln(msg)
+
+ def echoToLog(it: Iterator[String]): Unit = {
+ it.foreach(TestReporter.logPrint)
+ TestReporter.logFlush()
+ }
}
object SummaryReport {