diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-02-03 22:42:36 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-02-04 23:21:58 +0100 |
commit | 73fad44a11dafa507e1d358f1bc222b04319a594 (patch) | |
tree | f19126df90f4d76235515c56412997343030065a /test/dotty | |
parent | f926c8c14a7b48f2c0f3da680c69881ddfb9bf46 (diff) | |
download | dotty-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/dotty')
-rw-r--r-- | test/dotty/partest/DPDirectCompiler.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/dotty/partest/DPDirectCompiler.scala b/test/dotty/partest/DPDirectCompiler.scala index a6f11ec64..4e563820f 100644 --- a/test/dotty/partest/DPDirectCompiler.scala +++ b/test/dotty/partest/DPDirectCompiler.scala @@ -5,7 +5,7 @@ import scala.tools.partest.{ TestState, nest } import java.io.{ File, PrintWriter, FileWriter } -/* NOTE: Adapted from partest.DirectCompiler and DottyTest */ +/* NOTE: Adapted from partest.DirectCompiler */ class DPDirectCompiler(runner: DPTestRunner) extends nest.DirectCompiler(runner) { override def compile(opts0: List[String], sources: List[File]): TestState = { @@ -15,9 +15,7 @@ class DPDirectCompiler(runner: DPTestRunner) extends nest.DirectCompiler(runner) implicit val ctx: dotty.tools.dotc.core.Contexts.Context = { val base = new dotty.tools.dotc.core.Contexts.ContextBase - val ctx = base.initialCtx.fresh - base.definitions.init(ctx) - ctx + base.initialCtx.fresh } try { |