File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,8 +120,7 @@ jobs:
120120 cd build
121121 lcov --keep-going --ignore-errors mismatch --directory . --capture --output-file coverage.info
122122 lcov --ignore-errors mismatch --remove coverage.info '*/test/*' -o coverage.info
123- cd ..
124- gcovr -e test -e examples --sonarqube -u -o coverage.xml --exclude-throw-branches \
123+ gcovr --root .. -e '../test' -e '../examples' --sonarqube -o coverage.xml --exclude-throw-branches \
125124 --gcov-ignore-parse-errors --exclude-unreachable-branches
126125
127126 - name : Upload coverage to Codecov
@@ -141,7 +140,7 @@ jobs:
141140 -Dsonar.projectKey=simgrid_dtlmod
142141 -Dsonar.organization=simgrid
143142 -Dsonar.cfamily.compile-commands=build/compile_commands.json
144- -Dsonar.coverageReportPaths=coverage.xml
143+ -Dsonar.coverageReportPaths=build/ coverage.xml
145144
146145 - name : Build and deploy documentation
147146 if : github.ref == 'refs/heads/main' && env.TOKEN_GITHUB != ''
Original file line number Diff line number Diff line change @@ -217,6 +217,12 @@ set_target_properties(dtlmod PROPERTIES
217217 LINKER_LANGUAGE CXX
218218 PUBLIC_HEADER "${HEADER_FILES} " )
219219
220+ # Enable coverage for Debug builds
221+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
222+ target_compile_options (dtlmod PRIVATE -g -O0 --coverage )
223+ target_link_options (dtlmod PRIVATE --coverage )
224+ endif ()
225+
220226target_include_directories (dtlmod
221227 PUBLIC
222228 $<BUILD_INTERFACE :${CMAKE_SOURCE_DIR} /include >
You can’t perform that action at this time.
0 commit comments