musichoard/README.md
Wojciech Kozlowski fcbde5aecb
All checks were successful
Cargo CI / Build and Test (push) Successful in 2m14s
Cargo CI / Lint (push) Successful in 1m15s
Add a SQLite database backend (#265)
Part 1 of #248

Reviewed-on: #265
2025-01-12 10:24:53 +01:00

91 lines
2.0 KiB
Markdown

# Music Hoard
## Developing
### Pre-requisites
#### database-sqlite
This feature requires the `sqlite` library.
Either install system libraries: with
On Fedora:
``` sh
sudo dnf install sqlite-devel
```
Or use a bundled version by enabling the `database-sqlite-bundled` feature.
#### musicbrainz-api
This feature requires the `openssl` system library.
On Fedora:
``` sh
sudo dnf install openssl-devel
```
## Usage notes
### Text selection
To select and copy text use the terminal-specific modifier key (on Linux this is usually the Shift key).
## Code Coverage
### Pre-requisites
``` sh
rustup component add llvm-tools-preview
cargo install grcov
```
### Generating Code Coverage
```sh
env CARGO_TARGET_DIR=codecov \
rm -rf ./codecov/debug/{coverage,profraw}
env CARGO_TARGET_DIR=codecov \
cargo clean -p musichoard
env RUSTFLAGS="-C instrument-coverage" \
LLVM_PROFILE_FILE="codecov/debug/profraw/musichoard-%p-%m.profraw" \
CARGO_TARGET_DIR=codecov \
BEETSDIR=./ \
cargo test --all-features --all-targets
grcov codecov/debug/profraw \
--binary-path ./codecov/debug/ \
--output-types html \
--source-dir . \
--ignore-not-existing \
--ignore "build.rs" \
--ignore "examples/*" \
--ignore "tests/*" \
--ignore "src/main.rs" \
--ignore "src/bin/musichoard-edit.rs" \
--excl-line "^#\[derive|unimplemented\!\(|unreachable\!\(" \
--excl-start "GRCOV_EXCL_START|mod tests \{" \
--excl-stop "GRCOV_EXCL_STOP" \
--output-path ./codecov/debug/coverage/
xdg-open codecov/debug/coverage/index.html
```
Note that some changes may not be visible until `codecov/debug/coverage` is removed and the `grcov`
command is rerun.
For most cases `cargo clean` can be replaced with `rm -rf ./codecov/debug/{coverage,profraw}`.
## Benchmarks
### Pre-requisites
``` sh
rustup toolchain install nightly
```
### Running benchmarks
``` sh
env BEETSDIR=./ rustup run nightly cargo bench --all-features --all-targets
```