Skip to content

Commit f57327c

Browse files
committed
support running java-interop tests
1 parent 9135604 commit f57327c

File tree

12 files changed

+10
-3
lines changed

12 files changed

+10
-3
lines changed

test/dotc/tests.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,12 @@ class tests extends CompilerTest {
120120
"-Xprompt",
121121
"#runs", "2"))
122122

123+
val javaDir = "./tests/disabled/java-interop/"
124+
@Test def java_all = compileFiles(javaDir+"pos/")
125+
126+
@Test def java_2409 = compileDir(javaDir+"failing/t2409")
127+
@Test def java_1751 = compileDir(javaDir+"failing/t1751")
128+
@Test def java_294 = compileDir(javaDir+"failing/t294")
129+
123130
//@Test def dotc_compilercommand = compileFile(dotcDir + "tools/dotc/config/", "CompilerCommand")
124131
}

test/test/CompilerTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ class CompilerTest extends DottyTest {
2424
compileDir(Directory(path), args, xerrors)
2525

2626
def compileDir(dir: Directory, args: List[String], xerrors: Int)(implicit defaultOptions: List[String]): Unit = {
27-
val fileNames = dir.files.toArray.map(_.toString).filter(_ endsWith ".scala")
27+
val fileNames = dir.files.toArray.map(_.toString).filter(name => (name endsWith ".scala") || (name endsWith ".java"))
2828
compileArgs(fileNames ++ args, xerrors)
2929
}
3030

3131
def compileFiles(path: String, args: List[String] = Nil)(implicit defaultOptions: List[String]): Unit = {
3232
val dir = Directory(path)
33-
val fileNames = dir.files.toArray.map(_.toString).filter(_ endsWith ".scala")
33+
val fileNames = dir.files.toArray.map(_.toString).filter(name => (name endsWith ".scala") || (name endsWith ".java"))
3434
for (name <- fileNames) {
3535
println(s"testing $name")
3636
compileArgs((name :: args).toArray, 0)

tests/disabled/java-interop/pos/t1782/Test_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@ImplementedBy(classOf[Provider])
22
trait Service {
3-
def someMethod()
3+
def someMethod(): Unit
44
}
55

66
class Provider

0 commit comments

Comments
 (0)