From 4d0b595c2bee8b092ac3ee012f52c6a70e9bd816 Mon Sep 17 00:00:00 2001
From: Manos Koukoutos <emmanouil.koukoutos@epfl.ch>
Date: Tue, 8 Mar 2016 14:21:12 +0100
Subject: [PATCH] FrontendsSuite didn't run on xlang

---
 .../regression/frontends/FrontEndsSuite.scala | 21 ++++++++++---------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/test/scala/leon/regression/frontends/FrontEndsSuite.scala b/src/test/scala/leon/regression/frontends/FrontEndsSuite.scala
index 2919a605c..599fb0a41 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)
   }
-   
+
 }
-- 
GitLab