Skip to content

Commit

Permalink
Ignore negative counts when generating coverage info
Browse files Browse the repository at this point in the history
For some reason generating the coverage report yields a negative count
somewhere in `PersistentVariables.ipp`. I don't know why this happens.
Compiling with `-fprofile-update=atomic` as suggested by the error
message doesn't help. It only makes the SPI supervisor test require ~100
bytes more stack without getting rid of the error. Therefore, I followed
the second suggestion and changed the coverage command to ignore such
negative counts.
  • Loading branch information
PatrickKa committed Feb 8, 2025
1 parent fcbbdb3 commit abe7b38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmake/coverage.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ---- Variables ----

# We use variables separate from what CTest uses, because those have customization issues
set(COVERAGE_TRACE_COMMAND lcov -c -q -o "${PROJECT_BINARY_DIR}/coverage.info" -d
"${PROJECT_BINARY_DIR}" --include "${PROJECT_SOURCE_DIR}/*"
set(COVERAGE_TRACE_COMMAND
lcov -c -q -o "${PROJECT_BINARY_DIR}/coverage.info" -d "${PROJECT_BINARY_DIR}" --include
"${PROJECT_SOURCE_DIR}/*" --ignore-errors negative
CACHE STRING "; separated command to generate a trace for the 'coverage' target"
)

Expand Down

0 comments on commit abe7b38

Please sign in to comment.