2023-04-12 19:55:57 +02:00
|
|
|
# Music Hoard
|
|
|
|
|
2024-03-10 09:43:53 +01:00
|
|
|
## Developing
|
|
|
|
|
|
|
|
### Pre-requisites
|
|
|
|
|
|
|
|
#### musicbrainz-api
|
|
|
|
|
|
|
|
This feature requires the `openssl` system library.
|
|
|
|
|
|
|
|
On Fedora:
|
|
|
|
``` sh
|
|
|
|
sudo dnf install openssl-devel
|
|
|
|
```
|
|
|
|
|
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 \
|
2024-01-14 15:46:33 +01:00
|
|
|
rm -rf ./codecov/debug/{coverage,profraw}
|
|
|
|
env CARGO_TARGET_DIR=codecov \
|
|
|
|
cargo clean -p musichoard
|
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 \
|
2024-02-18 22:12:41 +01:00
|
|
|
--ignore "build.rs" \
|
2023-04-12 19:55:57 +02:00
|
|
|
--ignore "tests/*" \
|
|
|
|
--ignore "src/main.rs" \
|
2024-01-11 21:29:03 +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}`.
|
2024-02-18 22:12:41 +01:00
|
|
|
|
|
|
|
## Benchmarks
|
|
|
|
|
|
|
|
### Pre-requisites
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
rustup toolchain install nightly
|
|
|
|
```
|
|
|
|
|
|
|
|
### Running benchmarks
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
env BEETSDIR=./ rustup run nightly cargo bench --all-features --all-targets
|
|
|
|
```
|