Skip to content

Commit

Permalink
add coverage command using grcov
Browse files Browse the repository at this point in the history
  • Loading branch information
oriontvv committed Oct 20, 2024
1 parent 6c0ace2 commit 874c1f6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ test-linux-musl:
test:
cargo test --workspace

coverage:
rustup component add llvm-tools-preview
cargo install grcov
mkdir -p target/coverage
export RUSTFLAGS="-Cinstrument-coverage"
cargo build
LLVM_PROFILE_FILE='target/coverage/%p-%m.profraw' RUSTFLAGS='-C instrument-coverage' cargo test
grcov . -s . --binary-path ./target/debug -t html --branch --ignore-not-existing -o ./target/debug/coverage/
# open ./target/debug/coverage/index.html

fmt:
cargo fmt -- --check

Expand Down

0 comments on commit 874c1f6

Please sign in to comment.