Skip to content

Commit 65c5c08

Browse files
facontidavideclaude
andcommitted
Fix coverage CI: use atomic profile counters and ignore negative counts
Multi-threaded tests cause race conditions on gcov counters, producing negative counts that make lcov fail. Add -fprofile-update=atomic to compiler flags and --ignore-errors negative to lcov as a safety net. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 109ab77 commit 65c5c08

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/cmake_ubuntu.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ jobs:
6969
shell: bash
7070
run: |
7171
cmake --preset conan-debug \
72-
-DCMAKE_C_FLAGS="--coverage" \
73-
-DCMAKE_CXX_FLAGS="--coverage"
72+
-DCMAKE_C_FLAGS="--coverage -fprofile-update=atomic" \
73+
-DCMAKE_CXX_FLAGS="--coverage -fprofile-update=atomic"
7474
7575
- name: Build
7676
shell: bash
@@ -83,7 +83,8 @@ jobs:
8383
run: |
8484
lcov --capture --directory build/Debug \
8585
--output-file coverage.info \
86-
--ignore-errors mismatch
86+
--ignore-errors mismatch \
87+
--ignore-errors negative
8788
lcov --remove coverage.info \
8889
'/usr/*' \
8990
'*/3rdparty/*' \

0 commit comments

Comments
 (0)