[ golden ] Split runner to be able to run with custom options

This commit is contained in:
Denis Buzdalov 2022-09-27 21:22:03 +03:00 committed by G. Allais
parent 162d9e942b
commit 1402194f14

View File

@ -592,18 +592,15 @@ poolRunner opts pool
++ msgs
++ [ separator ]
||| A runner for a whole test suite
export
runner : List TestPool -> IO ()
runner tests
= do args <- getArgs
Just opts <- options args
| _ => do printLn args
putStrLn usage
runnerWith : Options -> List TestPool -> IO ()
runnerWith opts tests = do
-- if no CG has been set, find a sensible default based on what is available
opts <- case codegen opts of
Nothing => pure $ { codegen := !findCG } opts
Just _ => pure opts
-- run the tests
res <- concat <$> traverse (poolRunner opts) tests
@ -628,3 +625,13 @@ runner tests
if nfail == 0
then exitWith ExitSuccess
else exitWith (ExitFailure 1)
||| A runner for a whole test suite
export
runner : List TestPool -> IO ()
runner tests
= do args <- getArgs
Just opts <- options args
| _ => do printLn args
putStrLn usage
runnerWith opts tests