Skip to content

Commit ee7a8f1

Browse files
committed
Move JarOutputTests to SettingsTests
1 parent 93b1214 commit ee7a8f1

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

compiler/test/dotty/tools/dotc/JarOutputTests.scala

-25
This file was deleted.

compiler/test/dotty/tools/dotc/SettingsTests.scala

+16
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ package dotty.tools.dotc
33
import org.junit.Test
44
import org.junit.Assert._
55

6+
import java.nio.file._
7+
8+
import dotty.Jars
9+
import dotty.tools.vulpix.TestConfiguration.mkClassPath
10+
611
class SettingsTests {
712

813
@Test def missingOutputDir: Unit = {
@@ -11,4 +16,15 @@ class SettingsTests {
1116
assertEquals(1, reporter.errorCount)
1217
assertEquals("'not_here' does not exist or is not a directory", reporter.allErrors.head.message)
1318
}
19+
20+
@Test def jarOutput: Unit = {
21+
val classPath = mkClassPath(Jars.dottyTestDeps)
22+
val source = "../tests/neg/nolib/Foo.scala"
23+
val out = Paths.get("../out/jaredFoo.jar").normalize
24+
if (Files.exists(out)) Files.delete(out)
25+
val options = Array("-classpath", classPath, "-d", out.toString, source)
26+
val reporter = Main.process(options)
27+
assertEquals(0, reporter.errorCount)
28+
assertTrue(Files.exists(out))
29+
}
1430
}

0 commit comments

Comments
 (0)