1
1
package dotty .tools
2
2
package dotc
3
3
4
+ import reporting .StoreReporter
4
5
import vulpix .TestConfiguration
5
6
6
- import org .junit .Test
7
- import org .junit .Assert ._
7
+ import dotty .tools .vulpix .TestConfiguration .mkClasspath
8
8
9
9
import java .nio .file ._
10
10
11
- import dotty .tools .vulpix .TestConfiguration .mkClasspath
11
+ import org .junit .Test
12
+ import org .junit .Assert ._
12
13
13
14
class SettingsTests {
14
15
15
- @ Test def missingOutputDir : Unit = {
16
+ @ Test def missingOutputDir : Unit =
16
17
val options = Array (" -d" , " not_here" )
17
- val reporter = Main .process(options)
18
+ val reporter = Main .process(options, reporter = StoreReporter () )
18
19
assertEquals(1 , reporter.errorCount)
19
20
assertEquals(" 'not_here' does not exist or is not a directory or .jar file" , reporter.allErrors.head.message)
20
- }
21
21
22
22
@ Test def jarOutput : Unit = {
23
23
val source = " tests/pos/Foo.scala"
@@ -29,13 +29,12 @@ class SettingsTests {
29
29
assertTrue(Files .exists(out))
30
30
}
31
31
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
34
34
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 ())
38
39
assertEquals(1 , reporter.errorCount)
39
- }
40
-
41
40
}
0 commit comments