Skip to content

Commit

Permalink
ci(coverage): fix gcovr report generation (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Oct 13, 2024
1 parent 48ca85e commit 3372bf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ jobs:
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--verbose \
--xml-pretty \
-o coverage.xml
Expand Down Expand Up @@ -265,6 +266,10 @@ jobs:
name: coverage-${{ matrix.build_os }}
path: _coverage

- name: Debug coverage file
run: |
cat _coverage/coverage.xml
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Additional setup for coverage
# https://gcovr.com/en/stable/guide/compiling.html#compiler-options
#
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage -O0")
set(CMAKE_C_FLAGS "-fprofile-arcs -ftest-coverage -O0")
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage -ggdb -O0")
set(CMAKE_C_FLAGS "-fprofile-arcs -ftest-coverage -ggdb -O0")
endif()

enable_testing()
Expand Down

0 comments on commit 3372bf8

Please sign in to comment.