Verified Commit 061f3f3f authored by Camil Staps's avatar Camil Staps 🚀

Copy editing for !8

parent 7841e803
Pipeline #12734 passed with stage
in 37 seconds
...@@ -190,7 +190,7 @@ optionDescription = WithHelp True $ Options ...@@ -190,7 +190,7 @@ optionDescription = WithHelp True $ Options
(\mts opts -> (\mts -> {opts & hide=mts}) <$> (mapM parseMT $ split "," mts)) (\mts opts -> (\mts -> {opts & hide=mts}) <$> (mapM parseMT $ split "," mts))
"TYPES" "TYPES"
"Message types that should be hidden (start,pass,fail,skip,lost)" "Message types that should be hidden (start,pass,fail,skip,lost)"
, Shorthand "-sf" "--stop-on-first-failure" $ Flag , Shorthand "-F" "--stop-on-first-failure" $ Flag
"--stop-on-first-failure" "--stop-on-first-failure"
(\opts -> Ok {opts & stop_on_first_failure = True}) (\opts -> Ok {opts & stop_on_first_failure = True})
"Stop after the first test failed" "Stop after the first test failed"
...@@ -228,18 +228,18 @@ Start w ...@@ -228,18 +228,18 @@ Start w
# runs = case fromJSON (fromString l) of # runs = case fromJSON (fromString l) of
Nothing -> map JustRun opts.test_options.runs Nothing -> map JustRun opts.test_options.runs
Just res -> makeRuns res opts.strategy opts.test_options.runs Just res -> makeRuns res opts.strategy opts.test_options.runs
# (_,rrs,w) = seqSt (runIfContinued opts) runs (True, [], w) # (_,rrs,w) = seqSt (runIteration opts) runs (True, [], w)
// Save results // Save results
# (_,f,w) = fopen ".ctest-results.json" FWriteText w # (_,f,w) = fopen ".ctest-results.json" FWriteText w
# f = f <<< toJSON (mergeResults rrs) # f = f <<< toJSON (mergeResults rrs)
# (_,w) = fclose f w # (_,w) = fclose f w
= w = w
where where
runIfContinued opts test st=:(continue, rrs, w) runIteration :: !Options !SubTestRun !*(!Bool, ![RunResult], !*World) -> *(!Bool, ![RunResult], !*World)
| continue runIteration opts test (continue,rrs,w)
# (r, w) = run opts test w | not continue = (False, reverse rrs, w)
= (not $ opts.stop_on_first_failure && (r =: {result = Failed _}), [r: rrs], w) # (r,w) = run opts test w
| otherwise = st = (not $ opts.stop_on_first_failure && r.result=:Failed _, [r:rrs], w)
exit :: String *World -> *World exit :: String *World -> *World
exit error w = snd $ fclose (stderr <<< error <<< "\n") $ setReturnCode 1 w exit error w = snd $ fclose (stderr <<< error <<< "\n") $ setReturnCode 1 w
...@@ -396,13 +396,15 @@ where ...@@ -396,13 +396,15 @@ where
}) io }) io
= (Error oserr, output, io, w) = (Error oserr, output, io, w)
# [out,err:_] = fromOk ss # [out,err:_] = fromOk ss
# (output,(continue, io)) = append out (\s (continue, io) -> if (continue || not opts.stop_on_first_failure) # (output,(continue,io)) = append out
( case fromJSON $ fromString s of (\s (continue,io)
Nothing -> (False, io) | not continue && opts.stop_on_first_failure
Just ev -> (not $ ev =: (EndEvent {event = Failed _}), emit ev io) -> (continue, io)
) -> case fromJSON $ fromString s of
(continue, io) Nothing -> (False, io)
) output (True, io) Just ev -> (not $ ev=:(EndEvent {event=Failed _}), emit ev io))
output
(True, io)
# w = snd $ fclose (stderr <<< err) w # w = snd $ fclose (stderr <<< err) w
= (Ok continue, output, io, w) = (Ok continue, output, io, w)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment