Files
protocol-rs/justfile
T
swaits 670321efd1 ci: GitHub Actions workflow + drop test-fuzz-long
Eight parallel jobs on push/PR:

- test × 3 (default / no-default / all-features) via nextest + doc
- clippy × 3 feature permutations, -D warnings
- fmt
- doc (all-features, -D warnings on rustdoc)
- deny (cargo-deny action)
- miri (nightly, lib + vectors under default + no-default)
- fuzz (nightly, 60 s smoke on every target)
- mutants × 2 feature configs (same equivalence exclusions as local)

Swatinem/rust-cache on every cargo job; taiki-e/install-action for
nextest / cargo-fuzz / cargo-mutants. Uploads mutants.out on failure.

Drops test-fuzz-long from the justfile — 60 s per target in CI every
push plus the local proptest 1M-case suite already covers this.
2026-04-13 12:12:12 -06:00

91 lines
3.1 KiB
Makefile

# donglora-protocol development tasks
# default: list all recipes
default:
@just --list
# run ALL quality gates (tests, clippy, fmt, doc, deny, fuzz, miri, mutants)
test: test-unit test-clippy test-fmt test-doc test-deny test-fuzz test-miri test-mutants
# quick compile check (all feature permutations)
check:
cargo check
cargo check --no-default-features
cargo check --all-features
# unit + proptest + doc tests
test-unit:
cargo nextest run
cargo nextest run --no-default-features
cargo nextest run --all-features
cargo test --doc
# clippy with warnings as errors across feature permutations
test-clippy:
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --no-default-features -- -D warnings
cargo clippy --all-targets --all-features -- -D warnings
# check formatting
test-fmt:
cargo fmt -- --check
# doc build (catches broken doc links)
test-doc:
cargo doc --no-deps --all-features
# license and advisory audit
test-deny:
cargo deny check
# fuzz every target for 60s (requires nightly + cargo-fuzz)
test-fuzz:
cd fuzz && cargo +nightly fuzz run parse_command -- -max_total_time=60
cd fuzz && cargo +nightly fuzz run parse_radio_config -- -max_total_time=60
cd fuzz && cargo +nightly fuzz run cobs_decoder_feed -- -max_total_time=60
cd fuzz && cargo +nightly fuzz run cobs_roundtrip -- -max_total_time=60
cd fuzz && cargo +nightly fuzz run command_roundtrip -- -max_total_time=60
cd fuzz && cargo +nightly fuzz run cobs_decoder_multi_frame -- -max_total_time=60
cd fuzz && cargo +nightly fuzz run cobs_chunk_invariant -- -max_total_time=60
# run tests under miri (catches UB, requires nightly + miri component)
# The proptest suite is skipped — its file-persistence layer calls getcwd
# which miri does not support. Vectors and unit tests run clean.
test-miri:
cargo +nightly miri nextest run --lib --test vectors
cargo +nightly miri nextest run --lib --test vectors --no-default-features
# mutation testing (requires cargo-mutants).
#
# Runs under both feature configurations so that feature-gated paths
# (currently only the defmt::Format derives) are covered in both shapes.
# Three mutants are excluded as provably equivalent — swapping the
# operator does not change behaviour because a downstream check catches
# the resulting case. See the regex strings for the specific sites.
test-mutants: test-mutants-default test-mutants-no-default
test-mutants-default:
cargo mutants --no-shuffle --test-tool=nextest \
-E 'replace > with >= in Command::from_bytes' \
-E 'replace > with >= in CobsDecoder::feed' \
-E 'replace < with <= in cobs_encode_response'
test-mutants-no-default:
cargo mutants --no-shuffle --test-tool=nextest --no-default-features \
-E 'replace > with >= in Command::from_bytes' \
-E 'replace > with >= in CobsDecoder::feed' \
-E 'replace < with <= in cobs_encode_response'
# format code
fmt:
cargo fmt
# build in release mode
build:
cargo build --release
# clean all build artifacts
clean:
cargo clean
rm -rf fuzz/target fuzz/corpus fuzz/artifacts