diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-07 15:13:06 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-07 15:13:06 +0100 |
commit | 2935c4fc45497a43f76a6eaacef427748f4ab501 (patch) | |
tree | f22add715e32a3df67a9615aa1aa68f973c65727 /test | |
parent | c643ff5a38812e00ea7d6fbae94114beacd14ecf (diff) | |
download | dotty-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')
-rw-r--r-- | test/test/CompilerTest.scala | 13 |
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) |