aboutsummaryrefslogtreecommitdiff
path: root/doc/developer-notes.md
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-08-05 13:16:58 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-08-16 21:19:12 +0100
commit8b6f1c4353836bae6aa683cbc65251165bd031ba (patch)
treecc21c669859a4e0aa2e40112514d046eca191280 /doc/developer-notes.md
parent65bdbc1ff23b0a817f4d9a4682e6f630c9bbdd59 (diff)
downloadbitcoin-8b6f1c4353836bae6aa683cbc65251165bd031ba.tar.xz
cmake: Add `Coverage` and `CoverageFuzz` scripts
Diffstat (limited to 'doc/developer-notes.md')
-rw-r--r--doc/developer-notes.md23
1 files changed, 16 insertions, 7 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 93de6ce671..3066aabe60 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -476,25 +476,34 @@ $ ./test/functional/test_runner.py --valgrind
### Compiling for test coverage
-LCOV can be used to generate a test coverage report based upon `make check`
+LCOV can be used to generate a test coverage report based upon `ctest`
execution. LCOV must be installed on your system (e.g. the `lcov` package
on Debian/Ubuntu).
To enable LCOV report generation during test runs:
```shell
-./configure --enable-lcov
-make
-make cov
+cmake -B build -DCMAKE_BUILD_TYPE=Coverage
+cmake --build build
+cmake -P build/Coverage.cmake
-# A coverage report will now be accessible at `./test_bitcoin.coverage/index.html`,
-# which covers unit tests, and `./total.coverage/index.html`, which covers
+# A coverage report will now be accessible at `./build/test_bitcoin.coverage/index.html`,
+# which covers unit tests, and `./build/total.coverage/index.html`, which covers
# unit and functional tests.
```
Additional LCOV options can be specified using `LCOV_OPTS`, but may be dependent
on the version of LCOV. For example, when using LCOV `2.x`, branch coverage can be
-enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`, when configuring.
+enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`:
+
+```
+cmake -DLCOV_OPTS="--rc branch_coverage=1" -P build/Coverage.cmake
+```
+
+To enable test parallelism:
+```
+cmake -DJOBS=$(nproc) -P build/Coverage.cmake
+```
### Performance profiling with perf