diff --git a/src/test/scala/leon/regression/frontends/FrontEndsSuite.scala b/src/test/scala/leon/regression/frontends/FrontEndsSuite.scala index 2919a605cdd2b4a06a160c2d3464f032aa8a3c38..599fb0a41a331ff86005338b50bb44fc7819eb5d 100644 --- a/src/test/scala/leon/regression/frontends/FrontEndsSuite.scala +++ b/src/test/scala/leon/regression/frontends/FrontEndsSuite.scala @@ -4,16 +4,16 @@ package leon.regression.frontends import leon._ import leon.test._ -import purescala.Definitions.Program import java.io.File class FrontEndsSuite extends LeonRegressionSuite { - // Hard-code output directory, for Eclipse purposes - val pipeFront = frontends.scalac.ExtractionPhase andThen new utils.PreprocessingPhase + def testFrontend(f: File, xlang: Boolean, forError: Boolean) = { + val pipeline = + frontends.scalac.ExtractionPhase andThen + new utils.PreprocessingPhase(xlang) andThen + NoopPhase() - def testFrontend(f: File, pipeBack: Pipeline[Program, Program], forError: Boolean) = { - val pipeline = pipeFront andThen pipeBack test ("Testing " + f.getName) { val ctx = createLeonContext() if (forError) { @@ -24,7 +24,6 @@ class FrontEndsSuite extends LeonRegressionSuite { pipeline.run(ctx, List(f.getAbsolutePath)) } } - } private def forEachFileIn(path : String)(block : File => Unit) { @@ -35,14 +34,16 @@ class FrontEndsSuite extends LeonRegressionSuite { } } - val pipeNormal = xlang.NoXLangFeaturesChecking andThen NoopPhase() // redundant NoopPhase to trigger throwing error between phases val baseDir = "regression/frontends/" forEachFileIn(baseDir+"passing/") { f => - testFrontend(f, pipeNormal, false) + testFrontend(f, false, false) } forEachFileIn(baseDir+"error/simple/") { f => - testFrontend(f, pipeNormal, true) + testFrontend(f, false, true) + } + forEachFileIn(baseDir+"error/xlang/") { f => + testFrontend(f, true, true) } - + }