Skip to content

Commit d8d005b

Browse files
committed
ci: better coverage reporting
1 parent 4ea9c3e commit d8d005b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
with:
6464
args: >
6565
--define sonar.cfamily.compile-commands=build/compile_commands.json
66-
--define sonar.coverageReportPaths=build/coverage/coverage.xml
66+
--define sonar.coverageReportPaths=build/coverage/coverage.xml,build/coverage/coverage-examples.xml
6767
env:
6868
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6969

test/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ if(ENABLE_COVERAGE)
7575
COMMAND ${CMAKE_COMMAND} -E rm -rf "${PROJECT_BINARY_DIR}/coverage"
7676
COMMAND ${CMAKE_COMMAND} -E make_directory "${PROJECT_BINARY_DIR}/coverage"
7777
COMMAND
78-
gcovr -f "${PROJECT_SOURCE_DIR}/src/" -f "${PROJECT_SOURCE_DIR}/examples/" -r "${PROJECT_SOURCE_DIR}"
78+
gcovr -f "${PROJECT_SOURCE_DIR}/examples/" -r "${PROJECT_SOURCE_DIR}"
79+
--exclude-noncode-lines --exclude-throw-branches --exclude-unreachable-branches --decisions
80+
--gcov-executable="${GCOV_TOOL}"
81+
--gcov-exclude-directories "${PROJECT_SOURCE_DIR}/vcpkg"
82+
--gcov-delete
83+
--sonarqube "${PROJECT_BINARY_DIR}/coverage/coverage-examples.xml"
84+
COMMAND
85+
gcovr -f "${PROJECT_SOURCE_DIR}/src/" -r "${PROJECT_SOURCE_DIR}"
7986
--html-details -o "${PROJECT_BINARY_DIR}/coverage/index.html"
8087
--exclude-noncode-lines --exclude-throw-branches --exclude-unreachable-branches --decisions
8188
--gcov-executable="${GCOV_TOOL}"

0 commit comments

Comments
 (0)