Add guide how to generate test coverage reports. (#5289)

This commit is contained in:
Rot127 2025-08-01 10:55:37 +00:00 committed by GitHub
parent fd41e61d30
commit d15db13c6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -132,6 +132,34 @@ copied on other systems if necessary. On *NIX systems, this adds the classic
$ meson --buildtype=release --default-library=static -Dstatic_runtime=true build
```
## Build and generate coverage report
Use `-Db_coverage=true` during the setup phase.
```
$ meson -Db_coverage=true --buildtype=debug build
```
Run the command you need the coverage for.
```sh
# For example the ARM asm tests
rz-test test/db/asm/arm*
```
Generate the coverage report as HTML with `gcovr`.
```bash
# Install gcovr via pip or any other way
pip install gcovr
mkdir cov_report
cd cov_report
# Generate coverage report for each directory and file
gcovr -r .. --html-nested coverage.html
```
Open `coverage.html` in your browser and explore.
## Cross-compilation for Android
You can cross-compile rizin from your main machine to target your Android