Re: How to run test coverage on Debian 13 ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: How to run test coverage on Debian 13 ?
Date: 2026-10-03 16:21:45
Message-ID: 75993.1791044505@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com> writes:
> I'm trying to test run test coverage using master branch on Debian 13 with:
> ...
> postgres(at)alma:~/postgresql$ make coverage-html
> /usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d .
> -o lcov_base.info
> lcov: ERROR: (usage) duplicate file ./src/backend/parser/scan.gcno in
> both . and .
>     (use "lcov --ignore-errors usage ..." to bypass this error)
> Message summary:
>   1 error message:
>     usage: 1
> make: *** [src/Makefile.global:1065: lcov_base.info] Error 1

Yeah, recent versions of lcov are rather broken :-(.
Best bet is to apply "--ignore-errors" liberally,
and even then you'll get a bunch of useless warnings.
The output seems correct despite all that.

My coverage-running script currently does this so that
I don't see any complaints:

-----
# In RHEL 10.1 (LCOV version 2.0-1), we need a bunch of options
# to silence useless-and-probably-bogus warnings.
make -s coverage-html \
LCOVFLAGS="-q --ignore-errors gcov,gcov" \
GENHTML_FLAGS="-q --legend --ignore-errors unmapped,unmapped" \
2>&1 | grep -v -e 'gcno:no functions found$' -e '^stderr:$' \
-e 'WARNING: Duplicate specification "base-directory' \
-e 'WARNING: Duplicate specification "build-directory'
-----

You might want to leave out the "grep -v" part until you've
satisfied yourself that no interesting messages are produced
on your installation.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-10-03 16:22:35 Re: How to run test coverage on Debian 13 ?
Previous Message Vik Fearing 2026-10-03 16:18:43 Re: Logical Implication