From 3372bf853ba1645fb557cf212cdd650059c38d04 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 13 Oct 2024 11:31:14 -0400 Subject: [PATCH] ci(coverage): fix gcovr report generation (#118) --- .github/workflows/ci.yml | 5 +++++ CMakeLists.txt | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1be3904..beb592c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,6 +210,7 @@ jobs: --exclude-noncode-lines \ --exclude-throw-branches \ --exclude-unreachable-branches \ + --verbose \ --xml-pretty \ -o coverage.xml @@ -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: diff --git a/CMakeLists.txt b/CMakeLists.txt index 710ef4b..887edf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()