mirror of
https://github.com/microsoft/GSL.git
synced 2026-01-25 16:42:24 +01:00
* infra: individual test executables We used have tests contained in a single executable. This was fine for testing, but it would be more convient to separate tests into indivudal modules so targeted changes could have targeted tests. This change associates each test file with its own executable. We now have 14 tests for GSL each of which testing a different component. * revert -Wno-reserved-identifier * Update tests/span_tests.cpp thanks copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * be sure to include build type in ctest command * [VS] make sure we are building the correct configuration * restore tests/span_tests.cpp * fix build break after merge conflicts * fix build break after merge conflicts #2 * another try at fixing a build break * fix silly typo. build break pt 4 * Use file globbing for test sources instead of manual list (#1227) * Initial plan * Use file globbing for test sources instead of manual list Replace the manually maintained list of test sources with file(GLOB) to automatically discover all .cpp files in the tests directory, excluding no_exception_ensure_tests.cpp which needs special compilation flags. This approach: - Automatically picks up new test files without CMake updates - Still correctly excludes no_exception_ensure_tests.cpp - Maintains the same test build configuration - Works with both C++14 and C++20 Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
101 lines
3.2 KiB
YAML
101 lines
3.2 KiB
YAML
name: Compiler Integration Tests
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
# These jobs are correlated with the officially supported compilers
|
|
# and toolsets. If you change any versions, please update README.md.
|
|
|
|
jobs:
|
|
gcc:
|
|
strategy:
|
|
matrix:
|
|
gcc_version: [ 12, 13, 14 ]
|
|
build_type: [ Debug, Release ]
|
|
cxx_version: [ 14, 17, 20, 23 ]
|
|
exclude:
|
|
# https://github.com/google/googletest/issues/4232
|
|
# Looks like GoogleTest is not interested in making version 1.14
|
|
# work with gcc-12.
|
|
- gcc_version: 12
|
|
cxx_version: 20
|
|
- gcc_version: 12
|
|
cxx_version: 23
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Run CMake (configure, build, test)
|
|
uses: ./.github/workflows/cmake
|
|
with:
|
|
cmake_preset: gcc-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}
|
|
|
|
clang:
|
|
strategy:
|
|
matrix:
|
|
clang_version: [ 16, 17, 18 ]
|
|
build_type: [ Debug, Release ]
|
|
cxx_version: [ 14, 17, 20, 23 ]
|
|
exclude:
|
|
# https://github.com/llvm/llvm-project/issues/93734
|
|
# Looks like clang fixed this issue in clang-18, but won't backport
|
|
# the fix.
|
|
- clang_version: 17
|
|
cxx_version: 23
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Run CMake (configure, build, test)
|
|
uses: ./.github/workflows/cmake
|
|
with:
|
|
cmake_preset: clang-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}
|
|
|
|
xcode:
|
|
strategy:
|
|
matrix:
|
|
xcode_version: [ '16.4' ]
|
|
build_type: [ Debug, Release ]
|
|
cxx_version: [ 14, 17, 20, 23 ]
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: select xcode version
|
|
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version }}.app
|
|
|
|
- name: Run CMake (configure, build, test)
|
|
uses: ./.github/workflows/cmake
|
|
with:
|
|
cmake_preset: clang-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}
|
|
extra_cmake_configure_args: '-DCMAKE_CXX_FLAGS="-isysroot \"$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk\""'
|
|
|
|
VisualStudio:
|
|
strategy:
|
|
matrix:
|
|
generator: [ 'Visual Studio 17 2022' ]
|
|
image: [ windows-2022, windows-2025 ]
|
|
build_type: [ Debug, Release ]
|
|
extra_args: [ '', '-T ClangCL' ]
|
|
cxx_version: [ 14, 17, 20, 23 ]
|
|
runs-on: ${{ matrix.image }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: microsoft/setup-msbuild@v2
|
|
|
|
- name: Run CMake (configure, build, test)
|
|
uses: ./.github/workflows/cmake
|
|
with:
|
|
cmake_preset: msvc-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}
|
|
extra_cmake_configure_args: ${{ matrix.extra_args }}
|
|
extra_cmake_build_args: --config ${{ matrix.build_type }}
|
|
extra_ctest_args: -C ${{ matrix.build_type }}
|
|
|