Coverage
Coverage Measurement
Wallet-core is a stable project, we value stability and safety over new features.
Test coverage is one important facet of assuring code quality, and we are strict about high test coverage.
Checking Coverage Summary in CI build
The Linux CI
and Linux CI Rust
CI builds (executed on PRs and commits) contain coverage measurement, and summary is available in the build output:
Detailed Coverage Report
Detailed coverage report can be generated locally. It includes file and line-level info on coverage.
Steps:
Run
tools/generate-file
to make sure new added files are generatedRun
cmake
with-DCODE_COVERAGE=ON
to enable coverage measurement
Build tests
Cleanup any old coverage files, and run unit tests
Generate coverage info (slow). With the
html
argument the script will generate HTML report as well:
if you see genhtml (from lcov) error on macOS like below:
please upgrade lcov
to min. 1.16
, or patch genhtml
(for example /usr/local/Cellar/lcov/1.15/libexec/bin/), change --no-strip-underscores
to --no-strip-underscore
Open the generated coverage/index.html
to view the report.
See also tools/coverage and linux-ci.yml
Detailed Rust Coverage Report
Detailed Rust coverage report can be generated locally. It includes file and line-level info on coverage.
Steps:
Switch to the nightly toolchain and install dev dependencies
Run Rust tests and generate coverage info (slow). With the
html
argument the script will generate HTML report as well:
Last updated