Skip to main content

run_tests

Function run_tests 

Source
pub fn run_tests<S: TestOutputSink>(
    plan: &TestPlan,
    sink: &mut S,
) -> Result<TestSummary, TestRunError>
Expand description

Run every executable in plan sequentially in the order produced by plan_tests. Each test runs to completion before the next starts; the runner does not introduce parallelism in this release. The returned TestSummary preserves the plan’s order so output stays deterministic.

A test executable’s stdout / stderr are forwarded to sink while the process is running and also captured to memory for the returned summary. Streaming sinks (see StreamingSink) write a header for each non-empty output chunk so multi-test runs are easy to read.

§Panics

Panics if a spawned child process does not expose stdout or stderr after the runner configured both streams as piped.

§Errors

Returns TestRunError: Spawn if a test executable cannot be started, Wait if waiting on a running child fails, OutputIo if reading the child’s stdout/stderr fails, and SinkIo if forwarding captured output to sink fails (propagated from the sink’s write_stdout / write_stderr).