Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing

The repository treats golden vectors and the Python reference model as the definition of correct behaviour. Rust, C and Python implementations must all replay the same scenarios.

One command

pixi run check     # run every local check
pixi run ci        # check plus the 60-second fuzz stage

The individual tasks are documented in Development and release.

Layers

LayerCommandWhat it proves
Formatting and lintpixi run fmt, pixi run clippyWorkspace, fuzz crate and standalone ROS 2 example are clean under -D warnings.
Rust unit and integration testspixi run testPrimitives, predictors, schema validation, encoder, decoder, codegen, C header shape.
Doctestspixi run docs-doctestsPublic Rust examples compile and run.
Golden vectorspixi run test / pixi run differentialAll 21 scenario vectors, 8 predictor traces and the manifest are replayed.
Differential tracespixi run differential-fullAll 10,000 fixed-seed traces are regenerated and hash-checked against the manifest.
Reference modelpixi run reference-tests, pixi run reference-modelStdlib Python oracle agrees with committed vectors.
C ABIpixi run c-header-check, pixi run c-abiHeader is current; C replays every vector with -Werror.
Python bindingspixi run python-testsPyO3 extension replays vectors and round-trips generated classes.
Embeddedpixi run embedded-build, pixi run no-alloc-entry-tests, pixi run no-alloc-stack-usageTrue no-alloc thumb build, zero steady-state allocations, recorded stack usage.
Determinismpixi run qemu-determinismHost and Cortex-M4 hashes agree.
Fuzzingpixi run fuzz, pixi run fuzz-acceptance60-second gate and 30-minute acceptance run on the 12-hour timer.
Examplespixi run examplesUDP, serial/COBS and ROS 2 codec self-tests pass.
Docspixi run docsBook, rustdoc, pdoc, Doxygen, site assembly and local link checks pass.

Golden vectors

tests/vectors/*.json contains hand-checked encoder/decoder scenarios, predictor traces, width cases, CRC/message-ID checks and a stale-frame case. Each scenario records schema YAML, operations, expected bytes and decoded output. Five diff_seed_*.json files are human-reviewed differential scenarios. traces.manifest.json records the generator version, seed range, frame count and SHA-256 of 10,000 generated traces; those traces are not committed.

Fuzzing

tests/fuzz is a standalone Cargo workspace with three libFuzzer targets: decoder_feed, schema_parse and yaml_to_schema. tools/run_fuzz.py supplies sanitizer-coverage flags on stable Rust, copies the 14-file seed corpus to a temporary directory, and stores crashes in a gitignored directory. The decoder target asserts that state_hashes(0) is unchanged whenever feed returns Err.

Reproducing a failure

Every runner names the failing vector, seed and step. For byte mismatches the message includes the first differing byte; for decoded values it names the field. Start with pixi run test, then narrow with the task from the table above. Do not regenerate golden vectors unless the wire contract itself changes.