cli::main
cli/src/main.mo
pub type TestFileOutcome {
tests_outcome (total : I64) (failed : I64),
skip_outcome (reason : String),
fail_outcome (reason : String),
}The per-file verdict, phrased as data rather than as a printed line, so
a tail can hand it back and the PARENT does the printing -- keeping every
runner-authored line in file order however many tails are in flight.
tests_outcome is a driver that ran and reported; the other two are the
file-level outcomes that move skipped/files_failed.
pub struct PendingTestFile {
fiber : Fiber TestFileOutcome,
file : String,
}One in-flight test tail. file lives here rather than on the fiber's
result because the parent already knows it, and a Fiber handle is
opaque -- there is nothing else to read off it.
pub struct TestFold {
tests_passed : I64,
tests_failed : I64,
files_failed : I64,
skipped : I64,
}The four counters run_test_loop threads, as one value: a fiber's
outcome is folded wherever the fiber is awaited, and one struct hands
that fold to a helper instead of re-threading four parameters.
pub struct FoldAndRest {
fold : TestFold,
rest : List PendingTestFile,
}What await_head gives back: the counters with the awaited file's
outcome folded in, and the tails still in flight behind it.