summaryrefslogtreecommitdiff
path: root/src/Run.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-08-24 21:59:35 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-08-24 21:59:35 +0200
commita44406e96d17790a82708b36f8214b4b58d44ac6 (patch)
tree4154270a5f3adcaa0526d359501ed47aff66c6fd /src/Run.hs
parentcab137da80bb68ea824f7a42c2d15c6cccd56c71 (diff)
Move repeat and keep-going options to TestOptions
Diffstat (limited to 'src/Run.hs')
-rw-r--r--src/Run.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Run.hs b/src/Run.hs
index 7dc5f5d..579fa20 100644
--- a/src/Run.hs
+++ b/src/Run.hs
@@ -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)