summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-05-12 22:34:36 +0200
committerPéter Diviánszky <divipp@gmail.com>2016-05-12 22:34:36 +0200
commit5e8656f3e3f169c62defc2d8573c66a679c4757e (patch)
treedcef816f86976dac319faeede3c40de0abeb689d /test
parent4460e137aaea9edf282de7e363f12507eacdc8a4 (diff)
remove deepseq from compiler lib dependencies
Diffstat (limited to 'test')
-rw-r--r--test/runTests.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/runTests.hs b/test/runTests.hs
index 8b6e1d4d..23891b77 100644
--- a/test/runTests.hs
+++ b/test/runTests.hs
@@ -4,6 +4,7 @@
4{-# LANGUAGE FlexibleContexts #-} 4{-# LANGUAGE FlexibleContexts #-}
5{-# LANGUAGE RecordWildCards #-} 5{-# LANGUAGE RecordWildCards #-}
6{-# LANGUAGE NoMonomorphismRestriction #-} 6{-# LANGUAGE NoMonomorphismRestriction #-}
7{-# LANGUAGE ScopedTypeVariables #-}
7module Main where 8module Main where
8 9
9import Data.Char 10import Data.Char
@@ -18,7 +19,10 @@ import Control.Concurrent
18import Control.Concurrent.Async 19import Control.Concurrent.Async
19import Control.Monad 20import Control.Monad
20import Control.Monad.Reader 21import Control.Monad.Reader
21import Control.Exception hiding (catch) 22--import Control.Monad.Except
23import Control.Monad.Catch
24import Control.Exception hiding (catch, bracket, finally, mask)
25--import Control.Exception hiding (catch)
22import Control.Monad.Trans.Control 26import Control.Monad.Trans.Control
23import Control.DeepSeq 27import Control.DeepSeq
24import System.Exit 28import System.Exit
@@ -81,6 +85,12 @@ timeOut dt d m =
81 <*> m 85 <*> m
82 <*> liftIO getCurrentTime 86 <*> liftIO getCurrentTime
83 87
88catchErr :: (MonadCatch m, NFData a, MonadIO m) => (String -> m a) -> m a -> m a
89catchErr er m = (force <$> m >>= liftIO . evaluate) `catch` getErr `catch` getPMatchFail
90 where
91 getErr (e :: ErrorCall) = catchErr er $ er $ show e
92 getPMatchFail (e :: PatternMatchFail) = catchErr er $ er $ show e
93
84------------------------------------------ 94------------------------------------------
85 95
86testDataPath = "./testdata" 96testDataPath = "./testdata"