summaryrefslogtreecommitdiff
path: root/src/Run.hs
diff options
context:
space:
mode:
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)