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.
This commit is contained in:
Marco Trevisan (Treviño) 2024-05-24 18:53:34 +02:00
parent 2c94349e79
commit 2665a34b3f
2 changed files with 4 additions and 1 deletions

View File

@ -174,7 +174,7 @@ fedora-x86_64:
stage: build stage: build
needs: [] needs: []
variables: variables:
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs" CFLAGS: "-coverage -ftest-coverage -fprofile-arcs -fprofile-update=atomic"
before_script: before_script:
- !reference [".build-linux", "before_script"] - !reference [".build-linux", "before_script"]
- !reference [".with-git", "before_script"] - !reference [".with-git", "before_script"]

View File

@ -17,3 +17,6 @@ lcov_excl_line = LCOV_EXCL_LINE|g_return_if_reached|g_return_val_if_reached|g_as
# When using dtrace some temporary files may be leaked as source files # When using dtrace some temporary files may be leaked as source files
ignore_errors = source ignore_errors = source
# Sometimes we may have negative counting despite using atomic profile update
ignore_errors = negative