2021-06-12 07:37:41 +02:00
|
|
|
#!/bin/bash
|
|
|
|
mkdir -p target/coverage/prof
|
|
|
|
rm target/coverage/prof/*.profraw
|
|
|
|
|
|
|
|
export RUSTC=./rustc_bs.sh
|
|
|
|
export RUSTFLAGS="-Zinstrument-coverage -Copt-level=0 -Clink-dead-code"
|
|
|
|
export LLVM_PROFILE_FILE="target/coverage/prof/opentally-%p-%m.profraw"
|
|
|
|
export CARGO_TARGET_DIR=target/coverage
|
|
|
|
cargo test
|
|
|
|
|
2021-06-14 06:43:08 +02:00
|
|
|
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
|