aboutsummaryrefslogtreecommitdiff
path: root/test/test/CompilerTest.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-02-03 22:42:36 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-02-04 23:21:58 +0100
commit73fad44a11dafa507e1d358f1bc222b04319a594 (patch)
treef19126df90f4d76235515c56412997343030065a /test/test/CompilerTest.scala
parentf926c8c14a7b48f2c0f3da680c69881ddfb9bf46 (diff)
downloaddotty-73fad44a11dafa507e1d358f1bc222b04319a594.tar.gz
dotty-73fad44a11dafa507e1d358f1bc222b04319a594.tar.bz2
dotty-73fad44a11dafa507e1d358f1bc222b04319a594.zip
Driver: properly use root Context passed as argument
Also CompilerTest no longer runs the compiler with the context DottyTest#ctx. Previously, we got away with this because Compiler#process ignored it and created a new Context, but this commit fixes this, and it is now very important that we use a different context for every test we compile. Since DottyTest#ctx was the only part of DottyTest we used, CompilerTest no longer extends DottyTest to make sure that we do not use it accidentally. If we want to use DottyTest as a base class for tests again, we will have to remove its implicit Context field first. Also do not try to initialize the definitions in the context used by partest, this is not necessary.
Diffstat (limited to 'test/test/CompilerTest.scala')
-rw-r--r--test/test/CompilerTest.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala
index c65710e7d..526392576 100644
--- a/test/test/CompilerTest.scala
+++ b/test/test/CompilerTest.scala
@@ -33,7 +33,7 @@ import org.junit.Test
* object Test { def main(args: Array[String]): Unit = ... }
* Classpath jars can be added to partestDeps in the sbt Build.scala.
*/
-abstract class CompilerTest extends DottyTest {
+abstract class CompilerTest {
/** Override with output dir of test so it can be patched. Partest expects
* classes to be in partest-generated/[kind]/[testname]-[kind].obj/ */
@@ -181,7 +181,7 @@ abstract class CompilerTest extends DottyTest {
private def compileArgs(args: Array[String], xerrors: Int = 0)(implicit defaultOptions: List[String]): Unit = {
val allArgs = args ++ defaultOptions
val processor = if (allArgs.exists(_.startsWith("#"))) Bench else Main
- val nerrors = processor.process(allArgs, ctx).errorCount
+ val nerrors = processor.process(allArgs).errorCount
assert(nerrors == xerrors, s"Wrong # of errors. Expected: $xerrors, found: $nerrors")
}