File tree 2 files changed +18
-5
lines changed
compiler/test/dotty/tools/vulpix
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
192
192
193
193
/** A runnable that logs its contents in a buffer */
194
194
trait LoggedRunnable extends Runnable {
195
- import TestReporter .logWriter
196
-
197
195
/** Instances of `LoggedRunnable` implement this method instead of the
198
196
* `run` method
199
197
*/
@@ -212,8 +210,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
212
210
213
211
final def run (): Unit = {
214
212
checkTestSource()
215
- logBuffer.iterator.foreach(logWriter.println)
216
- logWriter.flush()
213
+ summaryReport.echoToLog(logBuffer.iterator)
217
214
}
218
215
}
219
216
@@ -309,7 +306,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
309
306
protected def tryCompile (testSource : TestSource )(op : => Unit ): Unit =
310
307
try {
311
308
val testing = s " Testing ${testSource.title}"
312
- TestReporter .logWriter.println (testing)
309
+ summaryReport.echoToLog (testing)
313
310
if (! isInteractive) realStdout.println(testing)
314
311
op
315
312
} catch {
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ trait SummaryReporting {
34
34
35
35
/** Echo the summary report to the appropriate locations */
36
36
def echoSummary (): Unit
37
+
38
+ /** Echoes *immediately* to file */
39
+ def echoToLog (msg : String ): Unit
40
+
41
+ /** Echoes contents of `it` to file *immediately* then flushes */
42
+ def echoToLog (it : Iterator [String ]): Unit
37
43
}
38
44
39
45
/** A summary report that doesn't do anything */
@@ -45,6 +51,8 @@ final class NoSummaryReport extends SummaryReporting {
45
51
def addStartingMessage (msg : String ): Unit = ()
46
52
def addCleanup (f : () => Unit ): Unit = ()
47
53
def echoSummary (): Unit = ()
54
+ def echoToLog (msg : String ): Unit = ()
55
+ def echoToLog (it : Iterator [String ]): Unit = ()
48
56
}
49
57
50
58
/** A summary report that logs to both stdout and the `TestReporter.logWriter`
@@ -122,6 +130,14 @@ final class SummaryReport extends SummaryReporting {
122
130
// Perform cleanup callback:
123
131
if (cleanUps.nonEmpty) cleanUps.foreach(_.apply())
124
132
}
133
+
134
+ def echoToLog (msg : String ): Unit =
135
+ TestReporter .logPrintln(msg)
136
+
137
+ def echoToLog (it : Iterator [String ]): Unit = {
138
+ it.foreach(TestReporter .logPrint)
139
+ TestReporter .logFlush()
140
+ }
125
141
}
126
142
127
143
object SummaryReport {
You can’t perform that action at this time.
0 commit comments