Skip to content

Commit

Permalink
DOC: add instructions for code coverage measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Dec 19, 2021
1 parent f08b6c8 commit b8d8b68
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ Creating the HTML docs (which will be available in `target/doc/rtrb/index.html`)

cargo doc

To measure code coverage, nightly Rust is required, as well as a few additional dependencies:

rustup toolchain install nightly
rustup component add llvm-tools-preview
cargo install grcov

Test coverage data can be obtained and analyzed with these commands:

cargo clean
RUSTFLAGS="-Z instrument-coverage" RUSTDOCFLAGS="-Z instrument-coverage -Z unstable-options --persist-doctests target/debug/doctestbins" LLVM_PROFILE_FILE="coverage/%p-%m.profraw" cargo +nightly test
grcov coverage --source-dir . --binary-path target/debug --output-type html --output-path coverage

The last command creates an HTML report in `coverage/index.html`.


Minimum Supported `rustc` Version
---------------------------------
Expand Down

0 comments on commit b8d8b68

Please sign in to comment.