Skip to content

Commit 5e34031

Browse files
committed
Fix error printing in compiler test
Error messages were suppressed so far, now get printed.
1 parent dfa3280 commit 5e34031

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

test/test/CompilerTest.scala

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,14 @@ abstract class CompilerTest {
236236
val processor = if (allArgs.exists(_.startsWith("#"))) Bench else Main
237237
val storeReporter = new Reporter with UniqueMessagePositions with HideNonSensicalMessages {
238238
private val consoleReporter = new ConsoleReporter()
239-
private var innerStoreReporter = new StoreReporter(consoleReporter)
239+
private val innerStoreReporter = new StoreReporter(consoleReporter)
240240
def doReport(d: Diagnostic)(implicit ctx: Context): Unit = {
241-
if (innerStoreReporter == null) {
242-
consoleReporter.report(d)
243-
} else {
244-
innerStoreReporter.report(d)
245-
if (d.level == ERROR) {
246-
innerStoreReporter.flush()
247-
innerStoreReporter = null
248-
}
241+
if (d.level == ERROR) {
242+
innerStoreReporter.flush()
243+
consoleReporter.doReport(d)
249244
}
245+
else if (errorCount > 0) consoleReporter.doReport(d)
246+
else innerStoreReporter.doReport(d)
250247
}
251248
}
252249
val reporter = processor.process(allArgs, storeReporter)
@@ -260,6 +257,7 @@ abstract class CompilerTest {
260257
assert(nerrors == xerrors,
261258
s"""Wrong # of errors. Expected: $xerrors, found: $nerrors
262259
|Files with expected errors: $expectedErrorFiles
260+
|errors:
263261
""".stripMargin)
264262
// NEG TEST
265263
if (xerrors > 0) {

0 commit comments

Comments
 (0)