Coverage is generated with cargo-llvm-cov by default. The CI workflow uploads
LCOV data to Codecov and archives the generated report files.
Install the coverage tool if it is not already available:
cargo install cargo-llvm-covThe full test suite also expects the par2 reference binary to be on PATH.
The Nix development shell provides it through par2cmdline-turbo; GitHub
Actions installs the same tool before running coverage.
# Terminal summary
make coverage-quick
# HTML report
make coverage-html
# Open the HTML report
make coverage-open
# Generate all llvm-cov report formats
make coverage-llvm
# CI-style reports
make coverage-ciGenerated reports are written under target/coverage/:
summary.txt: text reporthtml/index.html: browsable HTML reportlcov.info: LCOV report for Codecov and other servicescobertura.xml: Cobertura XML report for CI systemscodecov.json: Codecov custom coverage JSON
The Makefile targets call scripts/coverage.sh. You can run it directly when
you need a specific format:
./scripts/coverage.sh html
./scripts/coverage.sh lcov
./scripts/coverage.sh cobertura
./scripts/coverage.sh all
./scripts/coverage.sh cleanExtra arguments are passed to the underlying test run:
./scripts/coverage.sh html -- test_main_packet_fieldsTarpaulin remains available as an optional comparison tool:
cargo install cargo-tarpaulin
make coverage-bothTarpaulin output is written to target/coverage/tarpaulin/.