Skip to content

Commit f7c0ddf

Browse files
committed
Merge bitcoin/bitcoin#30192: build: remove --enable-lcov-branch-coverage
cbd4640 build: remove --enable-lcov-branch-coverage (fanquake) Pull request description: This supports lcov `2.x` in the sense that we are no-longer hardcoding version specific options, and instead will use the `LCOV_OPTS` variable (which is the more flexible thing to do in any case). It's also quite likely that devs are already having to pass extra options to lcov `2.x`, given it's more stringent in terms of coverage generation and error checking. See this thread for an example: linux-test-project/lcov#238. Tested on one machine (LCOV 2.0, gcc 13.2) with: ```bash ./autogen.sh ./configure --enable-lcov CXXFLAGS="-fprofile-update=prefer-atomic" LCOV_OPTS="--rc branch_coverage=1 --ignore-errors mismatch" make make cov <snip> Processing file src/netaddress.cpp lines=521 hit=480 functions=72 hit=72 branches=675 hit=499 Overall coverage rate: lines......: 81.8% (79362 of 97002 lines) functions......: 77.8% (10356 of 13310 functions) branches......: 49.6% (130628 of 263196 branches) ``` and another machine (LCOV 2.1, Clang 18.1.3) with: ```bash ./autogen.sh ./configure --enable-lcov CC=clang CXX=clang++ LCOV_OPTS="--rc branch_coverage=1 --ignore-errors mismatch,inconsistent" make make cov <snip> Processing file src/util/strencodings.cpp lines=315 hit=311 functions=38 hit=38 branches=425 hit=357 Overall coverage rate: source files: 622 lines.......: 79.8% (70311 of 88132 lines) functions...: 78.1% (13968 of 17881 functions) branches....: 44.5% (157551 of 354317 branches) Message summary: 101 warning messages: count: 1 inconsistent: 100 3528 ignore messages: inconsistent: 3528 ``` Related to #28468. ACKs for top commit: theuni: utACK cbd4640 hebasto: ACK cbd4640, tested on Ubuntu 22.04. Tree-SHA512: 94eb01e0e236a480052749f6107b1d0d2e4f6f70a8eefd55fa9ba3d2f72996c9e8a0f28340698b7ac82e7a71e9cf799b7a53ddb6e435e5e9795f5f98a18820f7
2 parents e18accc + cbd4640 commit f7c0ddf

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

configure.ac

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,6 @@ AC_ARG_ENABLE([lcov],
238238
[use_lcov=$enableval],
239239
[use_lcov=no])
240240

241-
AC_ARG_ENABLE([lcov-branch-coverage],
242-
[AS_HELP_STRING([--enable-lcov-branch-coverage],
243-
[enable lcov testing branch coverage (default is no)])],
244-
[use_lcov_branch=yes],
245-
[use_lcov_branch=no])
246-
247241
AC_ARG_ENABLE([zmq],
248242
[AS_HELP_STRING([--disable-zmq],
249243
[disable ZMQ notifications])],
@@ -821,10 +815,8 @@ if test "$use_lcov" = "yes"; then
821815
AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"],
822816
[AC_MSG_ERROR([lcov testing requested but --coverage flag does not work])])
823817
CORE_CXXFLAGS="$CORE_CXXFLAGS -Og"
824-
fi
825818

826-
if test "$use_lcov_branch" != "no"; then
827-
AC_SUBST(LCOV_OPTS, "$LCOV_OPTS --rc lcov_branch_coverage=1")
819+
AC_SUBST(LCOV_OPTS)
828820
fi
829821

830822
dnl Check for endianness

doc/developer-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,10 @@ make cov
497497
# unit and functional tests.
498498
```
499499

500+
Additional LCOV options can be specified using `LCOV_OPTS`, but may be dependant
501+
on the version of LCOV. For example, when using LCOV `2.x`, branch coverage can be
502+
enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`, when configuring.
503+
500504
### Performance profiling with perf
501505

502506
Profiling is a good way to get a precise idea of where time is being spent in

doc/release-notes-30192.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Build
2+
-----
3+
4+
`--enable-lcov-branch-coverage` has been removed, given
5+
incompatibilities between lcov version 1 & 2. `LCOV_OPTS`
6+
should be used to set any options instead.

0 commit comments

Comments
 (0)