My understanding is that the wrapper is needed because we run lcov --gcov-tool /path/to/gcov
and our gcov is llvm-cov gcov
, so lcov --gcov-tool "llvm-cov gcov" other arguments
would not work.
It is also possible to generate the coverage without using gcov/lcov:
0... compile with clang++ -fprofile-instr-generate -fcoverage-mapping ...
1export LLVM_PROFILE_FILE="/tmp/coverage/%m-%p.profraw"
2... run unit + functional tests ...
3llvm-profdata merge /tmp/coverage/*.profraw -o all.profdata
4
5# Generate lcov-like html report:
6llvm-cov export -instr-profile=all.profdata -format=lcov src/test/test_bitcoin -object=src/bitcoind > coverage_lcov.info
7genhtml --output-directory /tmp/coverage/html --legend --branch-coverage coverage_lcov.info
8
9# Or generate llvm html report (better templates visualization!):
10llvm-cov show -instr-profile=all.profdata -format=html --output-dir=/tmp/coverage/html src/test/test_bitcoin -object=src/bitcoind