Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 724 Bytes

COVERAGE.md

File metadata and controls

31 lines (21 loc) · 724 Bytes

How to run tests with coverage

Info

Will use grcov

Prerequisites

# Install llvm-tools
rustup component add llvm-tools-preview

Usage

# Remove old data
find . -iname '*.profraw' -delete && (rm -r ./target/debug/coverage 2&>1 || true)

# Export ENVS
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off"

# ... run_tests ...
# After tests *.profraw files will be generated

# -s flag will looking for .profraw files
grcov ./crates/filter-list-manager  --binary-path ./target/debug -t html -s .  -o ./target/debug/coverage

open ./target/debug/coverage/index.html