diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dotc/comptest.scala | 21 | ||||
-rw-r--r-- | test/dotc/tests.scala | 1 | ||||
-rw-r--r-- | test/test/CompilerTest.scala | 6 | ||||
-rw-r--r-- | test/test/DottyTest.scala | 2 |
4 files changed, 27 insertions, 3 deletions
diff --git a/test/dotc/comptest.scala b/test/dotc/comptest.scala new file mode 100644 index 000000000..485469c1a --- /dev/null +++ b/test/dotc/comptest.scala @@ -0,0 +1,21 @@ +package dotc + +import test._ + +object comptest 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/" + + def main(args: Array[String]) = + compileArgs(Array( + dotcDir + "tools/dotc/CompilationUnit.scala", + dotcDir + "tools/dotc/core/Types.scala", + dotcDir + "tools/dotc/ast/Trees.scala", + "#runs", "2", + "-Ylog:frontend", + "-Xprompt")) + +// compileDir(dotcDir + "tools/dotc/printing", List("-Xprompt", "-Ylog:frontend", "#runs", "2", "-uniqid")) +}
\ No newline at end of file diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 776a29107..51982d0de 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -12,6 +12,7 @@ class tests extends CompilerTest { // "-Xprompt", // "-explaintypes", // "-Yshow-suppressed-errors", + "#runs", "2", "-pagewidth", "160") val posDir = "./tests/pos/" diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala index 106020106..26a0b3831 100644 --- a/test/test/CompilerTest.scala +++ b/test/test/CompilerTest.scala @@ -3,7 +3,7 @@ package test import scala.reflect.io._ import org.junit.Test import scala.collection.mutable.ListBuffer -import dotty.tools.dotc.Main +import dotty.tools.dotc.{Main, Bench, Driver} import dotty.tools.dotc.reporting.Reporter class CompilerTest extends DottyTest { @@ -11,7 +11,9 @@ class CompilerTest extends DottyTest { def defaultOptions: List[String] = Nil def compileArgs(args: Array[String], xerrors: Int = 0): Unit = { - val nerrors = Main.process(args ++ defaultOptions).count(Reporter.ERROR.level) + val allArgs = args ++ defaultOptions + val processor = if (allArgs.exists(_.startsWith("#"))) Bench else Main + val nerrors = processor.process(allArgs).count(Reporter.ERROR.level) assert(nerrors == xerrors, s"Wrong # of errors. Expected: $xerrors, found: $nerrors") } diff --git a/test/test/DottyTest.scala b/test/test/DottyTest.scala index 8d48bd58e..f2d3ef92e 100644 --- a/test/test/DottyTest.scala +++ b/test/test/DottyTest.scala @@ -29,7 +29,7 @@ class DottyTest { // .withSetting(uniqid, true) println(ctx.settings) - base.definitions.init() + base.definitions.init(ctx) ctx } |