diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-24 21:59:35 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-24 21:59:35 +0200 |
| commit | a44406e96d17790a82708b36f8214b4b58d44ac6 (patch) | |
| tree | 4154270a5f3adcaa0526d359501ed47aff66c6fd /src/Run.hs | |
| parent | cab137da80bb68ea824f7a42c2d15c6cccd56c71 (diff) | |
Move repeat and keep-going options to TestOptions
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) |