Skip to content

Commit 973b285

Browse files
committed
Quieter tests
1 parent 3e24960 commit 973b285

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Diagnostic._
1717
* - The reporter is not flushed and the message containers capture a
1818
* `Context` (about 4MB)
1919
*/
20-
class StoreReporter(outer: Reporter) extends Reporter {
20+
class StoreReporter(outer: Reporter = null) extends Reporter {
2121

2222
protected var infos: mutable.ListBuffer[Diagnostic] = null
2323

Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
package dotty.tools
22
package dotc
33

4+
import reporting.StoreReporter
45
import vulpix.TestConfiguration
56

6-
import org.junit.Test
7-
import org.junit.Assert._
7+
import dotty.tools.vulpix.TestConfiguration.mkClasspath
88

99
import java.nio.file._
1010

11-
import dotty.tools.vulpix.TestConfiguration.mkClasspath
11+
import org.junit.Test
12+
import org.junit.Assert._
1213

1314
class SettingsTests {
1415

15-
@Test def missingOutputDir: Unit = {
16+
@Test def missingOutputDir: Unit =
1617
val options = Array("-d", "not_here")
17-
val reporter = Main.process(options)
18+
val reporter = Main.process(options, reporter = StoreReporter())
1819
assertEquals(1, reporter.errorCount)
1920
assertEquals("'not_here' does not exist or is not a directory or .jar file", reporter.allErrors.head.message)
20-
}
2121

2222
@Test def jarOutput: Unit = {
2323
val source = "tests/pos/Foo.scala"
@@ -29,13 +29,12 @@ class SettingsTests {
2929
assertTrue(Files.exists(out))
3030
}
3131

32-
@Test def t8124: Unit = {
33-
val source = Paths.get("tests/pos/Foo.scala").normalize
32+
@Test def t8124: Unit =
33+
val source = Paths.get("tests/pos/Foo.scala").normalize
3434
val outputDir = Paths.get("out/testSettings").normalize
35-
if (Files.notExists(outputDir)) Files.createDirectory(outputDir)
36-
val options = Array("-encoding", "-d", outputDir.toString, source.toString)
37-
val reporter = Main.process(options)
35+
if Files.notExists(outputDir)
36+
Files.createDirectory(outputDir)
37+
val options = Array("-encoding", "-d", outputDir.toString, source.toString)
38+
val reporter = Main.process(options, reporter = StoreReporter())
3839
assertEquals(1, reporter.errorCount)
39-
}
40-
4140
}

0 commit comments

Comments
 (0)