chore: add grcov-coverage as an alternate report generation recipe

This commit is contained in:
Paul Campbell 2024-06-04 07:16:23 +01:00
parent e29c274aaf
commit d67b821130

View file

@ -21,3 +21,17 @@ start-ngrok:
coverage-update: coverage-update:
cargo tarpaulin --lib --out html cargo tarpaulin --lib --out html
echo "Now:\n\topen tarpaulin-report.html" echo "Now:\n\topen tarpaulin-report.html"
grcov-coverage:
#!/usr/bin/env bash
set -e
# an alternate coverage report
rustup component add llvm-tools-preview
export RUSTFLAGS="-Cinstrument-coverage"
cargo build
export LLVM_PROFILE_FILE="git-next-%p-%m.profraw"
cargo test
echo "Building report..."
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/
find . -name '*.profraw' -exec rm "{}" \;
echo "Now:\n\topen target/debug/coverage/index.html"