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/Cli.hs | |
parent | c00cbeaa5e8be56d5dcbd2cfcc3140a5e8d749a2 (diff) |
Move runTests to Biz.Test.run
Diffstat (limited to 'Biz/Cli.hs')
-rw-r--r-- | Biz/Cli.hs | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -18,16 +18,14 @@ module Biz.Cli where import Alpha -import qualified Data.Text as Text import qualified System.Console.Docopt as Docopt import qualified System.Environment as Environment -import qualified Test.Tasty as Tasty -import qualified Test.Tasty.Runners as Tasty +import qualified Biz.Test as Test data Plan cfg = Plan { help :: Docopt.Docopt, move :: Docopt.Arguments -> IO (), - test :: Tasty.TestTree, + test :: Test.Tree, tidy :: cfg -> IO () } @@ -37,20 +35,11 @@ main Plan {..} = +> Docopt.parseArgsOrExit help +> \args -> if args `has` Docopt.command "test" - then runTests test + then Test.run test else if args `has` Docopt.longOption "help" then Docopt.exitWithUsage help else move args -runTests :: Tasty.TestTree -> IO () -runTests 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 - has :: Docopt.Arguments -> Docopt.Option -> Bool has = Docopt.isPresent |