From d67b821130d1b73765ffcd60952a35141a4b8d3d Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 4 Jun 2024 07:16:23 +0100 Subject: [PATCH] chore: add grcov-coverage as an alternate report generation recipe --- justfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/justfile b/justfile index 4441466..661f703 100644 --- a/justfile +++ b/justfile @@ -21,3 +21,17 @@ start-ngrok: coverage-update: cargo tarpaulin --lib --out 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"