Skip to content

Commit 7e17657

Browse files
binary1248ChrisThrasher
authored andcommitted
Fixed coverage data not being collected for MinGW builds because OpenCPPCoverage relies on pdb data being available.
1 parent b17150d commit 7e17657

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ jobs:
128128
verbose: 2
129129
key: ${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.type.name }}
130130

131+
- name: Install Gcovr for MinGW
132+
if: matrix.type.name == 'Debug' && contains(matrix.platform.name, 'MinGW')
133+
uses: threeal/[email protected]
134+
with:
135+
packages: gcovr
136+
131137
- name: Cache OpenCppCoverage
132138
if: matrix.type.name == 'Debug' && runner.os == 'Windows'
133139
id: opencppcoverage-cache
@@ -193,11 +199,11 @@ jobs:
193199
find build/bin -name test-sfml-window -or -name test-sfml-window.exe -exec sh -c "{} *sf::Context* --section=\"Version String\" --success | grep OpenGL" \;
194200
195201
- name: Test
196-
if: runner.os == 'Windows'
202+
if: runner.os == 'Windows' && !contains(matrix.platform.name, 'MinGW')
197203
run: cmake --build build --target runtests --config ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }}
198204

199205
- name: Test
200-
if: runner.os != 'Windows'
206+
if: runner.os != 'Windows' || contains(matrix.platform.name, 'MinGW')
201207
run: |
202208
ctest --test-dir build --output-on-failure -C ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }} --repeat until-pass:3
203209
# Run gcovr to extract coverage information from the test run

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ if(SFML_OS_WINDOWS AND NOT SFML_USE_SYSTEM_DEPS)
152152
VERBATIM)
153153
endif()
154154

155-
if(SFML_ENABLE_COVERAGE AND SFML_OS_WINDOWS)
155+
if(SFML_ENABLE_COVERAGE AND SFML_OS_WINDOWS AND NOT SFML_COMPILER_GCC)
156156
# Try to find and use OpenCppCoverage for coverage reporting when building with MSVC
157157
find_program(OpenCppCoverage_BINARY "OpenCppCoverage.exe")
158158

0 commit comments

Comments
 (0)