musichoard/README.md

35 lines
824 B
Markdown
Raw Normal View History

# Music Hoard
## Code Coverage
### Pre-requisites
``` sh
rustup component add llvm-tools-preview
cargo install grcov
```
### Generating Code Coverage
```sh
2023-04-12 22:09:56 +02:00
env CARGO_TARGET_DIR=codecov \
cargo clean
env RUSTFLAGS="-C instrument-coverage" \
2023-04-12 22:09:56 +02:00
LLVM_PROFILE_FILE="codecov/debug/profraw/musichoard-%p-%m.profraw" \
CARGO_TARGET_DIR=codecov \
cargo test
2023-04-12 22:09:56 +02:00
grcov codecov/debug/profraw \
--binary-path ./codecov/debug/ \
--output-types html \
--source-dir . \
--ignore-not-existing \
--ignore "tests/*" \
--ignore "src/main.rs" \
--excl-start "mod tests \{" \
2023-04-12 22:09:56 +02:00
--output-path ./codecov/debug/coverage/
xdg-open codecov/debug/coverage/index.html
```
2023-04-12 22:09:56 +02:00
Note that some changes may not be visible until `codecov/debug/coverage` is removed and the `grcov`
command is rerun.