Skip to main content

Crate cabin_test

Crate cabin_test 

Source
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:

  1. The CLI builds the selected test targets through the ordinary cabin-build planner — no test-specific build machinery is invented here.
  2. This crate turns the resulting cabin_build::BuildGraph into a deterministic TestPlan.
  3. run_tests executes the plan sequentially, captures stdout / stderr from each test executable, and produces a TestSummary describing 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§

StreamingSink
A TestOutputSink that streams bytes to the supplied stdout/stderr writers. Each non-empty write prepends a header so the user can tell which executable is speaking.
TestExecutable
One executable in a TestPlan.
TestPlan
A finalized, ordered list of test executables to run.
TestRunResult
Result of running one test executable.
TestSummary
Aggregate summary of one cabin test run.

Enums§

TestRunError
Errors produced while running tests.
TestRunStatus
Outcome of one test executable.

Traits§

TestOutputSink
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 use null_sink to discard output.

Functions§

null_sink
A TestOutputSink that discards all bytes — useful for unit tests of the runner itself.
plan_tests
Build a TestPlan from a finished BuildGraph plus the originating PackageGraph.
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 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.