aboutsummaryrefslogtreecommitdiff
path: root/test/test/CompilerTest.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-07 15:13:06 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-07 15:13:06 +0100
commit2935c4fc45497a43f76a6eaacef427748f4ab501 (patch)
treef22add715e32a3df67a9615aa1aa68f973c65727 /test/test/CompilerTest.scala
parentc643ff5a38812e00ea7d6fbae94114beacd14ecf (diff)
downloaddotty-2935c4fc45497a43f76a6eaacef427748f4ab501.tar.gz
dotty-2935c4fc45497a43f76a6eaacef427748f4ab501.tar.bz2
dotty-2935c4fc45497a43f76a6eaacef427748f4ab501.zip
Generalize test infrastructure
Compiler tests can now be run with configurable number of compilers and runs in a compiler.
Diffstat (limited to 'test/test/CompilerTest.scala')
-rw-r--r--test/test/CompilerTest.scala13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala
index 09112be2f..26a0b3831 100644
--- a/test/test/CompilerTest.scala
+++ b/test/test/CompilerTest.scala
@@ -10,13 +10,12 @@ class CompilerTest extends DottyTest {
def defaultOptions: List[String] = Nil
- def compileArgs(args: Array[String], xerrors: Int = 0): Unit =
- if (args.exists(_.startsWith("#")))
- Bench.main(args ++ defaultOptions)
- else {
- val nerrors = Main.process(args ++ defaultOptions).count(Reporter.ERROR.level)
- assert(nerrors == xerrors, s"Wrong # of errors. Expected: $xerrors, found: $nerrors")
- }
+ def compileArgs(args: Array[String], xerrors: Int = 0): Unit = {
+ 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")
+ }
def compileLine(cmdLine: String, xerrors: Int = 0): Unit = compileArgs(cmdLine.split("\n"), xerrors)