classify_run_outcome

Function classify_run_outcome 

Source
pub fn classify_run_outcome(
    success: bool,
    records_empty: bool,
    has_failed_cell: bool,
    scheduler: Option<&str>,
    exit_code: Option<i32>,
) -> RunOutcome
Expand description

Decide the cargo ktstr verifier run outcome from nextest’s exit success, whether any per-cell records were produced, whether any of those records is a FAILED cell (already shown as a ✗ in the printed grid), and the optional --scheduler filter.

The dispatcher runs nextest with --no-tests=pass, so a run that selects zero verifier cells exits 0 (success) with empty records rather than nextest’s generic “no tests to run” (exit 4). That lets the dispatcher diagnose the empty case itself instead of surfacing a cryptic nextest exit:

  • --scheduler <NAME> set + no records: the name is not a declared scheduler, or its declared topology constraints / verifier-only exclusions reject every selected preset.
  • no --scheduler + no records: no declare_scheduler! is linked into a test binary the sweep sees, or every declared scheduler rejects all selected presets through those declaration-level gates.

A genuine build/exec failure still fails nextest (exit non-zero, which --no-tests=pass does not mask). When that nonzero exit is a REAL cell failure — has_failed_cell true and nextest handed back a numeric exit_code — the printed grid already shows the failing cell(s), so the outcome is RunOutcome::SilentExit (carry nextest’s code, emit no stderr line). Every other nonzero case — a build / internal failure that produced no failed cell, or a signal exit with no numeric code — stays RunOutcome::Failed with the descriptive message, as does each empty-record diagnostic.