diff options
Diffstat (limited to 'src/Run.hs')
| -rw-r--r-- | src/Run.hs | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1,5 +1,6 @@ module Run ( module Run.Monad, + runTests, runTest, LoadedModules(..), @@ -57,6 +58,19 @@ import Test import Test.Builtins +runTests :: Output -> TestOptions -> GlobalDefs -> [ Test ] -> IO Bool +runTests out opts gdefs tests = do + go $ concat $ replicate (optRepeat opts) tests + where + go (t : ts) = do + runTest out opts gdefs t >>= \case + True -> go ts + False + | optKeepGoing opts -> go ts >> return False + | otherwise -> return False + go [] = return True + + runTest :: Output -> TestOptions -> GlobalDefs -> Test -> IO Bool runTest out opts gdefs test = do let testDir = optTestDir opts </> T.unpack (textModuleName (testModuleName test) <> "." <> testName test) |