'make check' fails when building with gcov code coverage

Maarten Hoes hoes.maarten at gmail.com
Fri May 27 08:26:21 UTC 2022

On Fri, May 27, 2022 at 8:13 AM Miklos Vajna <vmiklos at collabora.com> wrote:

> Hi Maarten,
> On Wed, May 25, 2022 at 02:38:27PM +0200, Maarten Hoes <
> hoes.maarten at gmail.com> wrote:
> > I've been trying to run 'make check' in combination with building
> > LibreOffice with gcov code coverage, and get failures for the following
> > tests :
> >
> >
> > gb_GCOV=YES verbose=t make UITest_solver
> > gb_GCOV=YES verbose=t make CppunitTest_sccomp_solver
> > gb_GCOV=YES verbose=t make CppunitTest_sccomp_swarmsolvertest
> >
> >
> > I set the required *FLAGS on the autogen commandline, and ran make with
> > 'gb_GCOV=YES'.
> Could you please be more specific, exactly what environment variables
> do you set in your autogen.input?
> FWIW I usually just run coverage for some area of the codebase, using:
> https://cgit.freedesktop.org/libreoffice/contrib/dev-tools/tree/lcov/coverage.sh
> There we do not set any coverage-related environment variables in
> autogen.input, just use gb_GCOV=YES when building the relevant files as
> you already do.

The complete commandline's that I run are :

CFLAGS='-fprofile-arcs -ftest-coverage' CXXFLAGS='-fprofile-arcs
-ftest-coverage' LDFLAGS='-fprofile-arcs -lgcov' ./autogen.sh
--enable-python=internal --without-system-libs --without-system-headers
gb_GCOV=YES verbose=t make --output-sync=target
gb_GCOV=YES verbose=t make check -k --output-sync=target

I recently started a thread [1] that is about the (complete, not partial)
build with gcov failing for me if I only set 'gb_GCOV=YES' on the make
commandline. The build succeeds for me if I also set the required *FLAGS on
the autogen commandline. The failing parts when only using 'gb_GCOV=YES'
were/are 'liborcus' and 'expat'. Skia (I think) initially also broke the
build, but that was because of conflicts between clang and gcc [2], which
was resolved when I uninstalled clang. If I understand correctly, it was
intended to force skia to always be built with clang, but - intended or not
- at least on Linux it falls back on gcc (or skia gets skipped perhaps).

When looking at 'coverage.sh', it seems it only covers specific parts of
the build, and not everything, so perhaps it doesn't build the parts that
fail for me when not setting the additional *FLAGS ?

Anyway, if you feel that setting the additional *FLAGS in addition to
'gb_GCOV=YES' is not the right way to address the problem of the full build
with gcov failing for me, then perhaps we should revisit that thread [1],
before we continue looking at why 'make check' fails for me ?

- Maarten

See: "Compiling LO for lcov/gcov code coverage fails (gb_GCOV=YES)"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20220527/31bf452d/attachment.htm>

More information about the LibreOffice mailing list