Re: Having problems generating a code coverage report

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: Having problems generating a code coverage report
Date: 2026-01-22 01:59:45
Message-ID: bxrbuxmpin6a3gunynde7c67ircaud5sxmjgid5kpidyzic55a@tqsmafqk6wah
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2026-01-22 02:12:19 Re: log_min_messages per backend type
Previous Message Fujii Masao 2026-01-22 01:56:48 Re: Flush some statistics within running transactions