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
(\mts opts -> (\mts -> {opts & hide=mts}) <$> (mapM parseMT $ split "," mts))
"TYPES"
"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"
(\opts -> Ok {opts & stop_on_first_failure = True})
"Stop after the first test failed"
......@@ -228,18 +228,18 @@ Start w
# runs = case fromJSON (fromString l) of
Nothing -> map JustRun 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
# (_,f,w) = fopen ".ctest-results.json" FWriteText w
# f = f <<< toJSON (mergeResults rrs)
# (_,w) = fclose f w
= w
where
runIfContinued opts test st=:(continue, rrs, w)
| continue
# (r, w) = run opts test w
= (not $ opts.stop_on_first_failure && (r =: {result = Failed _}), [r: rrs], w)
| otherwise = st
runIteration :: !Options !SubTestRun !*(!Bool, ![RunResult], !*World) -> *(!Bool, ![RunResult], !*World)
runIteration opts test (continue,rrs,w)
| not continue = (False, reverse rrs, w)
# (r,w) = run opts test w
= (not $ opts.stop_on_first_failure && r.result=:Failed _, [r:rrs], w)
exit :: String *World -> *World
exit error w = snd $ fclose (stderr <<< error <<< "\n") $ setReturnCode 1 w
......@@ -396,13 +396,15 @@ where
}) io
= (Error oserr, output, io, w)
# [out,err:_] = fromOk ss
# (output,(continue, io)) = append out (\s (continue, io) -> if (continue || not opts.stop_on_first_failure)
( case fromJSON $ fromString s of
Nothing -> (False, io)
Just ev -> (not $ ev =: (EndEvent {event = Failed _}), emit ev io)
)
(continue, io)
) output (True, io)
# (output,(continue,io)) = append out
(\s (continue,io)
| not continue && opts.stop_on_first_failure
-> (continue, io)
-> case fromJSON $ fromString s of
Nothing -> (False, io)
Just ev -> (not $ ev=:(EndEvent {event=Failed _}), emit ev io))
output
(True, io)
# w = snd $ fclose (stderr <<< err) 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