I have heard writing tests is a good starting point for contributing to Bitcoin Core. How do I work out which parts or specific lines of the codebase need additional test coverage?
Asked
Active
Viewed 109 times
2 Answers
4
If your intention is to contribute to Bitcoin Core, you must be able to build these reports locally. So that you can compare if your changes have been effective at increasing coverage.
The general steps are:
- Download the code and compile it
- Install LCOV for report generation
- Configure bitcoin to enable line coverage, ie
--enable-lcov - Execute the coverage task, ie
make cov
Once you have the dev environment correctly setup, the commands are:
./configure --enable-lcov
make cov
The official docs are located here: developer-notes.md#compiling-for-test-coverage
givanse
- 220
- 1
- 9
-
2Here's a guide I wrote: https://givan.se/generate-bitcoin-line-coverage-reports – givanse Feb 27 '22 at 02:31
4
Marco Falke has a site that analyzes the current line, function and branch coverage for unit tests, functional tests and fuzz tests.
Alternatively, vasild runs clang's tools and then a script to highlight which lines in the coverage report have been modified by a particular patch (PR).
Michael Folkson
- 14,337
- 3
- 11
- 45
-
The link to MarcoFalke's website is dead, https://marcofalke.github.io/b-c-cov/ seems to be the new one. – stickies-v Jul 14 '23 at 11:22
-