From a44406e96d17790a82708b36f8214b4b58d44ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Mon, 24 Aug 2026 21:59:35 +0200 Subject: Move repeat and keep-going options to TestOptions --- src/Run.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Run.hs') 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) -- cgit v1.2.3