From 2eff71a3d0f747798b3d6b848d21cd55aee1a60e Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Tue, 2 May 2017 15:16:18 +0200 Subject: [PATCH] Enforce `-Ystop-after:pickler` on `-Ytest-pickler` --- compiler/src/dotty/tools/dotc/Run.scala | 8 +++++++- compiler/test/dotty/tools/vulpix/TestConfiguration.scala | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/Run.scala b/compiler/src/dotty/tools/dotc/Run.scala index 38bf80bad703..23c45e354b6c 100644 --- a/compiler/src/dotty/tools/dotc/Run.scala +++ b/compiler/src/dotty/tools/dotc/Run.scala @@ -66,8 +66,14 @@ class Run(comp: Compiler)(implicit ctx: Context) { protected def compileUnits() = Stats.monitorHeartBeat { ctx.checkSingleThreaded() + + // If testing pickler, make sure to stop after pickling phase: + val stopAfter = + if (ctx.settings.YtestPickler.value) List("pickler") + else ctx.settings.YstopAfter.value + val phases = ctx.squashPhases(ctx.phasePlan, - ctx.settings.Yskip.value, ctx.settings.YstopBefore.value, ctx.settings.YstopAfter.value, ctx.settings.Ycheck.value) + ctx.settings.Yskip.value, ctx.settings.YstopBefore.value, stopAfter, ctx.settings.Ycheck.value) ctx.usePhases(phases) var lastPrintedTree: PrintedTree = NoPrintedTree for (phase <- ctx.allPhases) diff --git a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala index dcf3fbaf08a3..242160074cde 100644 --- a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala +++ b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala @@ -58,7 +58,6 @@ object TestConfiguration { val picklingOptions = defaultOptions ++ Array( "-Xprint-types", "-Ytest-pickler", - "-Ystop-after:pickler", "-Yprintpos" ) val scala2Mode = defaultOptions ++ Array("-language:Scala2")