rust-managed/coverage.sh

18 lines
511 B
Bash
Raw Normal View History

2017-11-19 17:34:30 +08:00
#!/bin/bash -e
cargo rustc --features map -- --test -C link-dead-code -Z profile -Z no-landing-pads
2017-11-19 17:34:30 +08:00
LCOVOPTS=(
--gcov-tool llvm-gcov
--rc lcov_branch_coverage=1
--rc lcov_excl_line=assert
)
lcov "${LCOVOPTS[@]}" --capture --directory . --base-directory . \
-o target/coverage/raw.lcov
lcov "${LCOVOPTS[@]}" --extract target/coverage/raw.lcov "$(pwd)/*" \
-o target/coverage/raw_crate.lcov
genhtml --branch-coverage --demangle-cpp --legend \
-o target/coverage/ \
target/coverage/raw_crate.lcov