summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-02-15 16:07:04 +0100
committerPéter Diviánszky <divipp@gmail.com>2016-02-15 16:13:39 +0100
commitba107c3fde5013b779f4fc73b28a766413cdafa9 (patch)
tree5d6a4c28e4e0cdcc93746fed1fc51a7ff17143ea /test
parent3db0b64a6f3e28ae6cc351e6c84290d4db905fa7 (diff)
remove main modules from module cache
Diffstat (limited to 'test')
-rw-r--r--test/runTests.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/runTests.hs b/test/runTests.hs
index 9d435806..45833f59 100644
--- a/test/runTests.hs
+++ b/test/runTests.hs
@@ -6,6 +6,7 @@
6module Main where 6module Main where
7 7
8import Data.List 8import Data.List
9import Data.Either
9import Data.Time.Clock 10import Data.Time.Clock
10import Control.Applicative 11import Control.Applicative
11import Control.Concurrent 12import Control.Concurrent
@@ -181,7 +182,12 @@ doTest Config{..} (i, fn) = do
181 where 182 where
182 n = dropExtension fn 183 n = dropExtension fn
183 184
184 action = f <$> (Right <$> getDef n "main" Nothing) `catchMM` (\e is -> return $ Left (e, is)) 185 getMain n = do
186 r@(fname, x, _) <- getDef n "main" Nothing
187 when (isRight x) $ removeFromCache fname
188 return r
189
190 action = f <$> (Right <$> getMain n) `catchMM` (\e is -> return $ Left (e, is))
185 191
186 f | not $ isReject fn = \case 192 f | not $ isReject fn = \case
187 Left (e, i) -> Left (unlines $ tab "!Failed" e: listTraceInfos i, Failed) 193 Left (e, i) -> Left (unlines $ tab "!Failed" e: listTraceInfos i, Failed)