Skip to main content

conformance_tests

Macro conformance_tests 

Source
macro_rules! conformance_tests {
    ($state_for:path; $($test:ident: $scenario:ident $(, ignore = $reason:literal)?;)+) => { ... };
}
Expand description

Generates a backend’s conformance tests: one #[test] per listed scenario, plus conformance_covers_every_scenario, which fails if any scenario in SCENARIOS has no test.

$state_for is a fn(&Scenario) -> VehicleState that builds the simulator’s native report for the scenario and runs it through the backend. Each row is test_name: SCENARIO, optionally followed by , ignore = "reason" for a known failure.

§Examples

use stable_flight::VehicleState;
use stable_flight::testing::conformance::Scenario;

// A real backend builds its simulator's native report here.
fn state_for(scenario: &Scenario) -> VehicleState {
    scenario.expected_state()
}

stable_flight::conformance_tests! {
    state_for;
    conforms_level: LEVEL;
    conforms_roll_right_30: ROLL_RIGHT_30;
    conforms_pitch_up_15: PITCH_UP_15, ignore = "pitch sign not converted yet";
}