Commit Graph

8 Commits

Author SHA1 Message Date
Philip Withnall
e115eafb8a
lcov: Fix use of deprecated lcov_branch_coverage option
This option was renamed to `branch_coverage` in more recent versions of
lcov. This might explain why branch coverage is not being collected by
CI at the moment.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-09-28 22:38:00 +01:00
Marco Trevisan (Treviño)
2f938054e9 ci: Also compile C++ files with coverage collection 2024-08-02 13:57:29 +02:00
Marco Trevisan (Treviño)
48ef51f568 ci: Ignore empty lcov files such as the baselines ones 2024-08-02 13:57:29 +02:00
Marco Trevisan (Treviño)
c320bb0bf8 ci: Ignore unused patterns
gnulib doesn't seem to be used at the moment so its _build folder, but let's
still try and don't fail if that's not happening
2024-08-02 03:39:49 +02:00
Marco Trevisan (Treviño)
2665a34b3f ci: Update coverage files atomically
Since we run tests in parallel we may end up rewriting the coverage info
while running files acting on the same source files.

The compiler can be smart though, so let's use the proper flag.

Despite this, sometimes we may still end up into negative reports, so
let's ignore them in CI since it's not worth breaking the build because
of these coverage-parsing failures.
2024-08-02 03:39:48 +02:00
Marco Trevisan (Treviño)
2c94349e79 ci: Ignore lcov errors on source missing
When using dtrace some temporary files may be leaked as source files and
this may lead to build issues such as

  geninfo: ERROR: unable to open
    /builds/GNOME/glib/_build/.dtrace-temp.ed1c5ba9.c:
    No such file or directory

AFAIK there's no way to keep these temporary files around, so the only
thing we can do is making lcov less strict about missing files.

We can drop the special option from genhtml since it's using the same
lcovrc file
2024-08-02 03:39:47 +02:00
Philip Withnall
60a9991f72 build: Ignore branches in g_clear_*() functions under lcov
It’s not useful for lcov to demand branch coverage of all branches
within `g_clear_*()` functions (such as `g_clear_pointer()`). By
choosing to use `g_clear_*()`, the programmer explicitly doesn’t care
about whether the pointer is `NULL`. The tests shouldn’t have to either.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-18 13:06:10 +00:00
Philip Withnall
8e295e23a5 build: Move lcovrc file to root so it’s picked up by Meson
Move the lcovrc file to the root of the project, so that it’s picked up
by Meson when running `ninja coverage` locally.

See https://github.com/mesonbuild/meson/issues/4628

This won’t affect the code coverage run on the CI, since that explicitly
used the lcovrc file already.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-04-28 11:57:45 +01:00