Skip to content

Commit

Permalink
ci: run VC tests under sdlprocdump
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Jul 7, 2024
1 parent 58e179c commit 7e8eb79
Show file tree
Hide file tree
Showing 3 changed files with 566 additions and 10 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
fail-fast: false
matrix:
platform:
- { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' }
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' }
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON }
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON }
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
- { name: Windows (ARM), flags: -A ARM }
- { name: Windows (ARM64), flags: -A ARM64 }
- { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64', artifact: 'SDL-VC-x64' }
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32', artifact: 'SDL-VC-x86' }
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON, artifact: 'SDL-static-crt-x64' }
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON, artifact: 'SDL-static-crt-x86' }
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64, artifact: 'SDL-clang-cl-x64' }
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32, artifact: 'SDL-clang-cl-x86' }
- { name: Windows (ARM), flags: -A ARM, artifact: 'SDL-VC-arm32' }
- { name: Windows (ARM64), flags: -A ARM64, artifact: 'SDL-VC-arm64' }
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true,
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0', artifact: 'SDL-VC-UWP' }

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -51,11 +51,13 @@ jobs:
-DSDL_INSTALL_TESTS=ON `
-DSDL_VENDOR_INFO="Github Workflow" `
-DSDL2_DISABLE_INSTALL=OFF `
-DSDLTEST_PROCDUMP=ON `
${{ matrix.platform.flags }} `
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build (CMake)
run: cmake --build build/ --config Release --parallel
- name: Run build-time tests
id: tests
if: "! contains(matrix.platform.name, 'ARM')"
run: |
$env:SDL_TESTS_QUICK=1
Expand All @@ -71,10 +73,21 @@ jobs:
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} `
${{ matrix.platform.flags }}
cmake --build cmake_config_build --config Release
- uses: actions/upload-artifact@v4
if: ${{ always() && steps.tests.outcome == 'failure' }}
with:
if-no-files-found: ignore
name: '${{ matrix.platform.artifact }}-minidumps'
path: build/**/*.dmp
- name: Add msbuild to PATH
if: ${{ matrix.platform.project != '' }}
uses: microsoft/setup-msbuild@v2
- name: Build msbuild
if: ${{ matrix.platform.project != '' }}
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
- uses: actions/upload-artifact@v4
if: ${{ always() && steps.tests.outcome == 'failure' }}
with:
if-no-files-found: ignore
name: '${{ matrix.platform.artifact }}-minidumps'
path: build/**/*.dmp
10 changes: 10 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ set(SDL_TEST_EXECUTABLES)
set(SDL_TESTS_NONINTERACTIVE)
set(SDL_TESTS_NEEDS_RESOURCES)

if(WIN32 AND NOT WINDOWS_STORE)
option(SDLTEST_PROCDUMP "Run tests using sdlprocdump for minidump generation" OFF)
add_executable(sdlprocdump win32/sdlprocdump.c)
if(SDLTEST_PROCDUMP)
set(CMAKE_TEST_LAUNCHER "$<TARGET_FILE:sdlprocdump>")
else()
set_property(TARGET sdlprocdump PROPERTY EXCLUDE_FROM_ALL "1")
endif()
endif()

macro(add_sdl_test_executable TARGET)
cmake_parse_arguments(AST "NONINTERACTIVE;NEEDS_RESOURCES" "" "" ${ARGN})
if(ANDROID)
Expand Down
Loading

0 comments on commit 7e8eb79

Please sign in to comment.