Use llvm-cov for coverage reporting

grcov reports incorrect coverage, e.g. showing blank lines as uncovered
This commit is contained in:
RunasSudo 2021-06-14 14:43:08 +10:00
parent c89c8b060c
commit f9d47533ee
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
1 changed files with 7 additions and 4 deletions

View File

@ -8,7 +8,10 @@ export LLVM_PROFILE_FILE="target/coverage/prof/opentally-%p-%m.profraw"
export CARGO_TARGET_DIR=target/coverage
cargo test
grcov target/coverage/prof --binary-path target/coverage/debug -t html -o target/coverage/html \
--ignore src/numbers/rational_num.rs \
--ignore src/stv/wasm.rs \
--ignore 'tests/*'
llvm-profdata merge -sparse target/coverage/prof/*.profraw -o target/coverage/opentally.profdata
llvm-cov show target/coverage/debug/opentally -instr-profile=target/coverage/opentally.profdata -Xdemangler="$HOME/.cargo/bin/rustfilt" \
-ignore-filename-regex="$HOME/." \
-ignore-filename-regex=numbers/rational_num.rs \
-ignore-filename-regex=stv/wasm.rs \
-format=html --show-instantiations=false --output-dir=target/coverage/html