Skip to main content

run

Function run 

Source
pub fn run<I, S>(args: I) -> Result<i32>
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,
Expand description

Runs the wrapped cargo test to completion and returns the exit code to propagate, after printing the grouped failure report and the run summary.

Stdout is piped so the runner can pick out the structured-error marker lines; every other line is teed straight through, so the wrapped build still looks like an ordinary cargo test run. Stderr is inherited untouched. While the build runs, a live progress counter is shown on stderr when stderr is a TTY (and the per-test ... ok lines are then folded into it instead of being teed). The grouped report and summary table are printed once the child has exited.

A process ended by a signal reports no exit code; that maps to 101, the code cargo itself uses for an abnormally terminated test binary, so the runner’s exit code still means “something went wrong”.

§Errors

Returns the std::io::Error from spawning cargo if the process could not be started at all (for example, cargo is not on PATH).