mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Fixed coverage data not being collected for MinGW builds because OpenCPPCoverage relies on pdb data being available.
This commit is contained in:
parent
b17150d3c0
commit
7e1765717a
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -128,6 +128,12 @@ jobs:
|
||||
verbose: 2
|
||||
key: ${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.type.name }}
|
||||
|
||||
- name: Install Gcovr for MinGW
|
||||
if: matrix.type.name == 'Debug' && contains(matrix.platform.name, 'MinGW')
|
||||
uses: threeal/pipx-install-action@v1.0.0
|
||||
with:
|
||||
packages: gcovr
|
||||
|
||||
- name: Cache OpenCppCoverage
|
||||
if: matrix.type.name == 'Debug' && runner.os == 'Windows'
|
||||
id: opencppcoverage-cache
|
||||
@ -193,11 +199,11 @@ jobs:
|
||||
find build/bin -name test-sfml-window -or -name test-sfml-window.exe -exec sh -c "{} *sf::Context* --section=\"Version String\" --success | grep OpenGL" \;
|
||||
|
||||
- name: Test
|
||||
if: runner.os == 'Windows'
|
||||
if: runner.os == 'Windows' && !contains(matrix.platform.name, 'MinGW')
|
||||
run: cmake --build build --target runtests --config ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }}
|
||||
|
||||
- name: Test
|
||||
if: runner.os != 'Windows'
|
||||
if: runner.os != 'Windows' || contains(matrix.platform.name, 'MinGW')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -C ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }} --repeat until-pass:3
|
||||
# Run gcovr to extract coverage information from the test run
|
||||
|
@ -152,7 +152,7 @@ if(SFML_OS_WINDOWS AND NOT SFML_USE_SYSTEM_DEPS)
|
||||
VERBATIM)
|
||||
endif()
|
||||
|
||||
if(SFML_ENABLE_COVERAGE AND SFML_OS_WINDOWS)
|
||||
if(SFML_ENABLE_COVERAGE AND SFML_OS_WINDOWS AND NOT SFML_COMPILER_GCC)
|
||||
# Try to find and use OpenCppCoverage for coverage reporting when building with MSVC
|
||||
find_program(OpenCppCoverage_BINARY "OpenCppCoverage.exe")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user