Base.hs 490 B

12345678910111213141516171819202122
  1. {-# LANGUAGE OverloadedStrings #-}
  2. module Base (simpleTest) where
  3. import Distribution.TestSuite
  4. import System.IO.Error
  5. simpleTest :: String -> IO Progress -> Test
  6. simpleTest n t =
  7. let test = TestInstance
  8. {run = t',
  9. name = n,
  10. tags = [],
  11. options = [],
  12. setOption = \_ _ -> Right test
  13. }
  14. in Test test
  15. where
  16. t' :: IO Progress
  17. t' = catchIOError t (
  18. \e -> return . Finished . Fail $ "Raised exception: " ++ show e
  19. )