Expand description
Test plan + sequential test runner for Cabin’s test
targets.
cabin test is intentionally a thin layer on top of the
existing build pipeline:
- The CLI builds the selected
testtargets through the ordinarycabin-buildplanner — no test-specific build machinery is invented here. - This crate turns the resulting
cabin_build::BuildGraphinto a deterministicTestPlan. run_testsexecutes the plan sequentially, captures stdout / stderr from each test executable, and produces aTestSummarydescribing what passed and what failed.
Crate boundary: this crate does not parse manifests, build
dependency graphs, generate Ninja, or know about config /
patches. The CLI orchestrates those layers and hands a
finished BuildGraph plus the per-package CWD policy to
plan_tests / run_tests.
Structs§
- Streaming
Sink - A
TestOutputSinkthat streams bytes to the supplied stdout/stderr writers. Each non-empty write prepends a header so the user can tell which executable is speaking. - Test
Executable - One executable in a
TestPlan. - Test
Plan - A finalized, ordered list of
testexecutables to run. - Test
RunResult - Result of running one test executable.
- Test
Summary - Aggregate summary of one
cabin testrun.
Enums§
- Test
RunError - Errors produced while running tests.
- Test
RunStatus - Outcome of one test executable.
Traits§
- Test
Output Sink - Sink for test executable output. The runner forwards stdout /
stderr chunks to this sink while each process is still
running, and also keeps a full captured copy in
TestRunResult. Tests in this crate usenull_sinkto discard output.
Functions§
- null_
sink - A
TestOutputSinkthat discards all bytes — useful for unit tests of the runner itself. - plan_
tests - Build a
TestPlanfrom a finishedBuildGraphplus the originatingPackageGraph. - render_
result_ line - Render the per-test result line emitted after each executable finishes.
- render_
running_ line - Render the per-test “running” header used by the CLI before each executable starts.
- render_
summary_ line - Format a one-line summary for display:
running N tests/test result: ok. P passed; F failed. Centralized here so the CLI does not invent its own format. - run_
tests - Run every executable in
plansequentially in the order produced byplan_tests. Each test runs to completion before the next starts; the runner does not introduce parallelism in this release. The returnedTestSummarypreserves the plan’s order so output stays deterministic.