Skip to main content

plan_tests

Function plan_tests 

Source
pub fn plan_tests(
    package_graph: &PackageGraph,
    build_graph: &BuildGraph,
    selected_packages: Option<&[usize]>,
) -> TestPlan
Expand description

Build a TestPlan from a finished BuildGraph plus the originating PackageGraph.

The plan picks every test target whose linked executable appears in graph.default_outputs (i.e. every test the build was asked to produce). test targets that the planner did not build are absent from the plan — that is the contract: callers select which test targets to build (typically through the planner’s manifest-target selector list), and plan_tests runs exactly the ones whose executable exists in the graph.

If selected_packages is Some, the plan is restricted to those package indices; passing None walks the graph’s primary set, matching the planner’s default selection.

Ordering is (package_name, target_name) ascending — the same order cabin metadata and the planner emit, so plans are deterministic across runs.