Skip to content

Commit ce329d1

Browse files
olhotakDarkDimius
authored andcommitted
support running java-interop tests
1 parent 08224d9 commit ce329d1

File tree

12 files changed

+11
-4
lines changed

12 files changed

+11
-4
lines changed

test/dotc/tests.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,12 @@ class tests extends CompilerTest {
132132
"-Xprompt",
133133
"#runs", "2"))
134134

135+
val javaDir = "./tests/disabled/java-interop/"
136+
@Test def java_all = compileFiles(javaDir+"pos/")
137+
138+
@Test def java_2409 = compileDir(javaDir+"failing/t2409")
139+
@Test def java_1751 = compileDir(javaDir+"failing/t1751")
140+
@Test def java_294 = compileDir(javaDir+"failing/t294")
141+
135142
//@Test def dotc_compilercommand = compileFile(dotcDir + "tools/dotc/config/", "CompilerCommand")
136143
}

test/test/CompilerTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class CompilerTest extends DottyTest {
2828
case "-deep" :: args1 => (dir.deepFiles, args1)
2929
case _ => (dir.files, args)
3030
}
31-
val fileNames = files.toArray.map(_.toString).filter(_ endsWith ".scala")
31+
val fileNames = files.toArray.map(_.toString).filter(name => (name endsWith ".scala") || (name endsWith ".java"))
3232
compileArgs(fileNames ++ normArgs, xerrors)
3333
}
3434

3535
def compileFiles(path: String, args: List[String] = Nil)(implicit defaultOptions: List[String]): Unit = {
3636
val dir = Directory(path)
37-
val fileNames = dir.files.toArray.map(_.toString).filter(_ endsWith ".scala")
37+
val fileNames = dir.files.toArray.map(_.toString).filter(name => (name endsWith ".scala") || (name endsWith ".java"))
3838
for (name <- fileNames) {
3939
println(s"testing $name")
4040
compileArgs((name :: args).toArray, 0)
@@ -57,4 +57,4 @@ object CompilerTest extends App {
5757

5858
// new CompilerTest().compileDir(dotcDir + "tools/dotc")
5959
// new CompilerTest().compileFile(dotcDir + "tools/dotc/", "Run")
60-
}
60+
}

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)