{-# LANGUAGE OverloadedStrings #-} module Base (simpleTest) where import Distribution.TestSuite import System.IO.Error simpleTest :: String -> IO Progress -> Test simpleTest n t = let test = TestInstance {run = t', name = n, tags = [], options = [], setOption = \_ _ -> Right test } in Test test where t' :: IO Progress t' = catchIOError t ( \e -> return . Finished . Fail $ "Raised exception: " ++ show e )