summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-11-30 11:26:59 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-11-30 11:26:59 +0100
commit5275180490e83ccbf435b3d736266651b5008f4e (patch)
treed385500ae317bf735b4f6ebdefdf791a52958226
parentf1605a5c15776189d5d2c3888760904018e8ba9a (diff)
erase Pipeline's info field before comparison
-rw-r--r--test/runTests.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/runTests.hs b/test/runTests.hs
index 153f8580..45e49805 100644
--- a/test/runTests.hs
+++ b/test/runTests.hs
@@ -36,6 +36,7 @@ import qualified Data.Text as T
36import qualified Data.Text.IO as TIO 36import qualified Data.Text.IO as TIO
37import Text.Printf 37import Text.Printf
38 38
39import qualified LambdaCube.IR as IR
39import LambdaCube.Compiler 40import LambdaCube.Compiler
40import LambdaCube.Compiler.Pretty hiding ((</>)) 41import LambdaCube.Compiler.Pretty hiding ((</>))
41 42
@@ -237,13 +238,13 @@ doTest Config{..} (i, fn) = do
237 return res 238 return res
238 239
239 --getDef :: MonadMask m => FilePath -> SName -> Maybe Exp -> MMT m (Infos, [Stmt]) ((Infos, [Stmt]), Either Doc (FilePath, Either Doc ExpType)) 240 --getDef :: MonadMask m => FilePath -> SName -> Maybe Exp -> MMT m (Infos, [Stmt]) ((Infos, [Stmt]), Either Doc (FilePath, Either Doc ExpType))
240 241 clearPipelineInfo p = p {IR.info = ""}
241 f ((i, desug), e) | not $ isReject fn = case e of 242 f ((i, desug), e) | not $ isReject fn = case e of
242 Left (_, show -> e) -> Left (unlines $ tab "!Failed" e: map show (listTraceInfos i), Failed) 243 Left (_, show -> e) -> Left (unlines $ tab "!Failed" e: map show (listTraceInfos i), Failed)
243 Right (fname, ge, Left (pShow -> e)) 244 Right (fname, ge, Left (pShow -> e))
244 -> Right ("typechecked module", simpleShow $ vcat $ e: showGE fname ge) 245 -> Right ("typechecked module", simpleShow $ vcat $ e: showGE fname ge)
245 Right (fname, ge, Right (ET e te)) 246 Right (fname, ge, Right (ET e te))
246 | te == outputType -> Right ("compiled pipeline", prettyShowUnlines $ compilePipeline OpenGL33 (ET e te)) 247 | te == outputType -> Right ("compiled pipeline", prettyShowUnlines $ clearPipelineInfo $ compilePipeline OpenGL33 (ET e te))
247 | e == trueExp -> Right ("reducted main", de) 248 | e == trueExp -> Right ("reducted main", de)
248 | te == boolType -> Left (tab "!Failed" $ "main should be True but it is \n" ++ simpleShow res, Failed) 249 | te == boolType -> Left (tab "!Failed" $ "main should be True but it is \n" ++ simpleShow res, Failed)
249 | otherwise -> Right ("reduced main :: " ++ simpleShow (mkDoc (True, False) te), de) 250 | otherwise -> Right ("reduced main :: " ++ simpleShow (mkDoc (True, False) te), de)