aboutsummaryrefslogtreecommitdiff
path: root/test/test/CompilerTest.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-07-16 15:14:10 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-16 15:16:05 +0200
commit5e340310a3a3b2a4bd1fc8071dc5d060bd2cc5bc (patch)
tree5b5f2edea60b504d9fbe109c66d2125dbc0de54b /test/test/CompilerTest.scala
parentdfa32801f5b2c774a8c792353c1bf1d1781a4a0e (diff)
downloaddotty-5e340310a3a3b2a4bd1fc8071dc5d060bd2cc5bc.tar.gz
dotty-5e340310a3a3b2a4bd1fc8071dc5d060bd2cc5bc.tar.bz2
dotty-5e340310a3a3b2a4bd1fc8071dc5d060bd2cc5bc.zip
Fix error printing in compiler test
Error messages were suppressed so far, now get printed.
Diffstat (limited to 'test/test/CompilerTest.scala')
-rw-r--r--test/test/CompilerTest.scala16
1 files changed, 7 insertions, 9 deletions
diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala
index 3ee5597e6..1d8fb9bf5 100644
--- a/test/test/CompilerTest.scala
+++ b/test/test/CompilerTest.scala
@@ -236,17 +236,14 @@ abstract class CompilerTest {
val processor = if (allArgs.exists(_.startsWith("#"))) Bench else Main
val storeReporter = new Reporter with UniqueMessagePositions with HideNonSensicalMessages {
private val consoleReporter = new ConsoleReporter()
- private var innerStoreReporter = new StoreReporter(consoleReporter)
+ private val innerStoreReporter = new StoreReporter(consoleReporter)
def doReport(d: Diagnostic)(implicit ctx: Context): Unit = {
- if (innerStoreReporter == null) {
- consoleReporter.report(d)
- } else {
- innerStoreReporter.report(d)
- if (d.level == ERROR) {
- innerStoreReporter.flush()
- innerStoreReporter = null
- }
+ if (d.level == ERROR) {
+ innerStoreReporter.flush()
+ consoleReporter.doReport(d)
}
+ else if (errorCount > 0) consoleReporter.doReport(d)
+ else innerStoreReporter.doReport(d)
}
}
val reporter = processor.process(allArgs, storeReporter)
@@ -260,6 +257,7 @@ abstract class CompilerTest {
assert(nerrors == xerrors,
s"""Wrong # of errors. Expected: $xerrors, found: $nerrors
|Files with expected errors: $expectedErrorFiles
+ |errors:
""".stripMargin)
// NEG TEST
if (xerrors > 0) {