Better support for fail-fast by fsoikin · Pull Request #140 · purescript-spec/purescript-spec

The original implementation in #137 was a bit lazy: due to accidental complexity, it was very hard to return the whole test tree if the execution was stopped on first failure. However, down the stack it turned out that we do need the full tree after all, so this PR makes it happen.

Instead of a downstream filtering pipe, the failFast option is now checked during the tree traversal, and a mutable cell is used to indicate when the execution ought to stop. When that mutable flag is set, the tree traversal itself still runs to the end, producing the full tree, even though the actual example execution gets skipped. Accordingly, in that case, skipped tests will show up in the results as "pending".

The mutable cell is used instead of a, say, StateT, because of parallelization, which doesn't support StateT.