diff options
-rw-r--r-- | test/dotc/tests.scala | 4 | ||||
-rw-r--r-- | test/test/CompilerTest.scala | 19 |
2 files changed, 22 insertions, 1 deletions
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 72167c53e..5bb86f79f 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -10,7 +10,7 @@ class tests extends CompilerTest { val posDir = "/Users/odersky/workspace/dotty/tests/pos/" val negDir = "/Users/odersky/workspace/dotty/tests/neg/" - + val dotcDir = "/Users/odersky/workspace/dotty/src/dotty/" @Test def pos_Coder() = compileFile(posDir, "Coder") @Test def pos_blockescapes() = compileFile(posDir, "blockescapes") @@ -37,4 +37,6 @@ class tests extends CompilerTest { @Test def neg_typedidents() = compileFile(negDir, "typedidents", xerrors = 2) @Test def neg_assignments() = compileFile(negDir, "assignments", xerrors = 3) @Test def neg_typers() = compileFile(negDir, "typers", xerrors = 10) + + @Test def dotc = compileDir(dotcDir + "tools/dotc") }
\ No newline at end of file diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala index 00c288546..106020106 100644 --- a/test/test/CompilerTest.scala +++ b/test/test/CompilerTest.scala @@ -20,4 +20,23 @@ class CompilerTest extends DottyTest { def compileFile(prefix: String, fileName: String, args: List[String] = Nil, xerrors: Int = 0): Unit = compileArgs((s"$prefix$fileName.scala" :: args).toArray, xerrors) + def compileDir(path: String, args: List[String] = Nil, xerrors: Int = 0): Unit = { + val dir = Directory(path) + val fileNames = dir.files.toArray.map(_.toString).filter(_ endsWith ".scala") + compileArgs(fileNames ++ args, xerrors) + } + +} +object CompilerText extends App { + +// val dotcDir = "/Users/odersky/workspace/dotty/src/dotty/" + +// new CompilerTest().compileFile(dotcDir + "tools/dotc/", "CompilationUnit") +// new CompilerTest().compileFile(dotcDir + "tools/dotc/", "Compiler") +// new CompilerTest().compileFile(dotcDir + "tools/dotc/", "Driver") +// new CompilerTest().compileFile(dotcDir + "tools/dotc/", "Main") +// new CompilerTest().compileFile(dotcDir + "tools/dotc/", "Run") + +// new CompilerTest().compileDir(dotcDir + "tools/dotc") + // new CompilerTest().compileFile(dotcDir + "tools/dotc/", "Run") }
\ No newline at end of file |