Re: Having problems generating a code coverage report - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Having problems generating a code coverage report
Date
Msg-id bxrbuxmpin6a3gunynde7c67ircaud5sxmjgid5kpidyzic55a@tqsmafqk6wah
Whole thread Raw
In response to Re: Having problems generating a code coverage report  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Having problems generating a code coverage report
List pgsql-hackers
Hi,

On 2026-01-22 09:48:35 +0900, Michael Paquier wrote:
> On Wed, Jan 21, 2026 at 01:57:58PM -0500, Andres Freund wrote:
> > I just encountered this. The problem seems to only happen when the build
> > directory is inside the source directory.
> > 
> > Not that that's a great solution, but just having the build dir be in a
> > separate directory fixed the issue for me.
> 
> Even with a VPATH build on Debien GID?

Well, mine was a meson build.


> meson is no better as far as I've tried, so I have pretty much given
> up with coverage reports in this environment at this stage.  If there
> is a magic recipe, I am not really aware of one..

I have the following .lcovrc in my postgres source dir:

ignore_errors=inconsistent,gcov,range
check_data_consistency=0
stop_on_error=0
genhtml_hierarchical=1
genhtml_show_navigation=1
parallel=16
geninfo_gcov_tool=/usr/bin/gcov-15

(assuming you build with gcc 15)

With that meson coverage information works (i.e. ninja coverage-html) for both
lcov 2.0 and 2.4 as long as the build directory is outside of the source
directory. Both on Debian Sid and macos.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Flush some statistics within running transactions
Next
From: "Euler Taveira"
Date:
Subject: Re: log_min_messages per backend type