diff options
author | Ben Sima <ben@bsima.me> | 2021-02-18 08:44:19 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2021-02-18 08:44:19 -0500 |
commit | c78119b0547cd9ef266db04a91a4d0e5be8340a8 (patch) | |
tree | 6686bfa410cc02b9a30e6c76f4fe9fcadbe7e1b6 /Biz/Test.hs | |
parent | c00cbeaa5e8be56d5dcbd2cfcc3140a5e8d749a2 (diff) |
Move runTests to Biz.Test.run
Diffstat (limited to 'Biz/Test.hs')
-rw-r--r-- | Biz/Test.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Biz/Test.hs b/Biz/Test.hs index fdd89f8..994a7ce 100644 --- a/Biz/Test.hs +++ b/Biz/Test.hs @@ -5,6 +5,7 @@ -- : dep tasty-quickcheck module Biz.Test ( Tree, + run, group, unit, prop, @@ -17,12 +18,24 @@ module Biz.Test where import Alpha hiding (group) +import qualified Data.Text as Text import qualified Test.Tasty as Tasty import qualified Test.Tasty.HUnit as HUnit import qualified Test.Tasty.QuickCheck as QuickCheck +import qualified Test.Tasty.Runners as Tasty type Tree = Tasty.TestTree +run :: Tree -> IO () +run tree = do + Tasty.installSignalHandlers + case Tasty.tryIngredients Tasty.defaultIngredients mempty tree of + Nothing -> do + hPutStrLn stderr <| Text.pack "no ingredients agreed to run" + exitFailure + Just act -> act +> \ok -> if ok then exitSuccess else exitFailure + + group :: Tasty.TestName -> [Tasty.TestTree] -> Tasty.TestTree group = Tasty.testGroup |