2023-04-12 19:55:57 +02:00
|
|
|
# Music Hoard
|
|
|
|
|
2023-05-21 22:48:48 +02:00
|
|
|
## Usage notes
|
|
|
|
|
|
|
|
### Text selection
|
|
|
|
|
|
|
|
To select and copy text use the terminal-specific modifier key (on Linux this is usually the Shift key).
|
|
|
|
|
2023-04-12 19:55:57 +02:00
|
|
|
## Code Coverage
|
|
|
|
|
|
|
|
### Pre-requisites
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
rustup component add llvm-tools-preview
|
|
|
|
cargo install grcov
|
|
|
|
```
|
|
|
|
|
|
|
|
### Generating Code Coverage
|
|
|
|
|
|
|
|
```sh
|
2023-04-13 14:09:59 +02:00
|
|
|
env CARGO_TARGET_DIR=codecov \
|
|
|
|
cargo clean
|
2023-04-12 19:55:57 +02:00
|
|
|
env RUSTFLAGS="-C instrument-coverage" \
|
2023-04-13 14:09:59 +02:00
|
|
|
LLVM_PROFILE_FILE="codecov/debug/profraw/musichoard-%p-%m.profraw" \
|
|
|
|
CARGO_TARGET_DIR=codecov \
|
2024-01-06 19:49:41 +01:00
|
|
|
BEETSDIR=./ \
|
2023-05-10 22:52:03 +02:00
|
|
|
cargo test --all-features --all-targets
|
2023-04-13 14:09:59 +02:00
|
|
|
grcov codecov/debug/profraw \
|
|
|
|
--binary-path ./codecov/debug/ \
|
2023-04-12 19:55:57 +02:00
|
|
|
--output-types html \
|
|
|
|
--source-dir . \
|
|
|
|
--ignore-not-existing \
|
|
|
|
--ignore "tests/*" \
|
|
|
|
--ignore "src/main.rs" \
|
2024-01-11 21:17:09 +01:00
|
|
|
--ignore "src/bin/musichoard-edit.rs" \
|
2024-01-06 19:49:41 +01:00
|
|
|
--excl-start "GRCOV_EXCL_START|mod tests \{" \
|
2023-04-13 14:09:59 +02:00
|
|
|
--excl-stop "GRCOV_EXCL_STOP" \
|
|
|
|
--output-path ./codecov/debug/coverage/
|
|
|
|
xdg-open codecov/debug/coverage/index.html
|
2023-04-12 19:55:57 +02:00
|
|
|
```
|
|
|
|
|
2023-04-13 14:09:59 +02:00
|
|
|
Note that some changes may not be visible until `codecov/debug/coverage` is removed and the `grcov`
|
2023-04-12 19:55:57 +02:00
|
|
|
command is rerun.
|
2023-04-13 14:09:59 +02:00
|
|
|
|
|
|
|
For most cases `cargo clean` can be replaced with `rm -rf ./codecov/debug/{coverage,profraw}`.
|