2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00

Update OSes in CI and run CMake tests (#207)

Fixes https://github.com/boostorg/pfr/issues/205
This commit is contained in:
Antony Polukhin
2025-06-11 21:40:44 +03:00
committed by GitHub
parent db9451143a
commit 57fa1018b0
2 changed files with 42 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- toolset: gcc-14 - toolset: gcc-14 # Do not remove! It is the only toolset that tests CMake tests down below
cxxstd: "03,11,14,17,20" cxxstd: "03,11,14,17,20"
os: ubuntu-24.04 os: ubuntu-24.04
- toolset: gcc-12 # Do not remove! It is the only toolset that tests misc/strip_boost_namespace.sh - toolset: gcc-12 # Do not remove! It is the only toolset that tests misc/strip_boost_namespace.sh
@@ -91,6 +91,18 @@ jobs:
./b2 -d0 headers ./b2 -d0 headers
./b2 variant=debug tools/inspect ./b2 variant=debug tools/inspect
- name: Run CMake tests
if: ${{matrix.toolset == 'gcc-14'}}
run: |
cd ../boost-root/
mkdir __build
cd __build
cmake -DBUILD_TESTING=1 -DBOOST_INCLUDE_LIBRARIES=pfr -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_C_COMPILER=gcc-14 ..
cmake --build . --target tests
ctest --output-on-failure --no-tests=error
cd ..
rm -rf __build
- name: Run modules tests - name: Run modules tests
if: false if: false
# if: ${{matrix.toolset == 'clang-19'}} # if: ${{matrix.toolset == 'clang-19'}}
@@ -159,17 +171,17 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- toolset: msvc-14.0 - toolset: msvc-14.3 # tests CMake tests down below, does not run b2 tests
cxxstd: "14,latest" cxxstd: "14,17,20,latest"
addrmd: 32,64 addrmd: 64
os: windows-2019 os: windows-2025
threads: "-j3" threads: "-j3"
- toolset: gcc - toolset: gcc
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
addrmd: 64 addrmd: 64
os: windows-2019 os: windows-2025
threads: "-j3" threads: "-j3"
- toolset: msvc-14.3 - toolset: msvc-14.3 # tests CMake tests down below
cxxstd: "20,latest" cxxstd: "20,latest"
addrmd: 64 addrmd: 64
os: windows-2022 os: windows-2022
@@ -206,6 +218,21 @@ jobs:
cmd /c bootstrap cmd /c bootstrap
b2 -d0 headers b2 -d0 headers
- name: Run CMake tests
if: ${{matrix.toolset == 'msvc-14.3'}}
shell: cmd
run: |
choco install --no-progress ninja
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" x64
cd ../boost-root/
mkdir __build
cd __build
cmake -DBUILD_TESTING=1 -DBOOST_INCLUDE_LIBRARIES=pfr ..
cmake --build . --target tests --config Debug
ctest --output-on-failure --no-tests=error -C Debug
cd ..
rm -rf __build
- name: Run modules tests - name: Run modules tests
if: false if: false
# if: ${{matrix.toolset == 'msvc-14.3'}} # if: ${{matrix.toolset == 'msvc-14.3'}}
@@ -238,6 +265,7 @@ jobs:
rm -rf build_module rm -rf build_module
- name: Run tests - name: Run tests
if: ${{matrix.os != 'windows-2025'}} # TODO: workaround issues
shell: cmd shell: cmd
run: | run: |
cd ../boost-root cd ../boost-root

View File

@@ -2,6 +2,10 @@
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
if(NOT TARGET tests)
add_custom_target(tests)
endif()
file(GLOB CORE_RUN_FILES "core/run/*.cpp") file(GLOB CORE_RUN_FILES "core/run/*.cpp")
foreach (testsourcefile ${CORE_RUN_FILES}) foreach (testsourcefile ${CORE_RUN_FILES})
get_filename_component(testname ${testsourcefile} NAME_WLE) get_filename_component(testname ${testsourcefile} NAME_WLE)
@@ -9,13 +13,16 @@ foreach (testsourcefile ${CORE_RUN_FILES})
target_link_libraries(pfr_core_${testname} Boost::pfr) target_link_libraries(pfr_core_${testname} Boost::pfr)
target_include_directories(pfr_core_${testname} PRIVATE ../../../) target_include_directories(pfr_core_${testname} PRIVATE ../../../)
add_test(NAME pfr_core_${testname} COMMAND pfr_core_${testname}) add_test(NAME pfr_core_${testname} COMMAND pfr_core_${testname})
add_dependencies(tests pfr_core_${testname})
endforeach() endforeach()
file(GLOB CORE_NAME_RUN_FILES "core_name/run/*.cpp") file(GLOB CORE_NAME_RUN_FILES "core_name/run/*.cpp")
foreach (testsourcefile ${CORE_NAME_RUN_FILES}) foreach (testsourcefile ${CORE_NAME_RUN_FILES})
get_filename_component(testname ${testsourcefile} NAME_WLE) get_filename_component(testname ${testsourcefile} NAME_WLE)
add_executable(pfr_corename_${testname} ${testsourcefile}) add_executable(pfr_corename_${testname} ${testsourcefile})
target_compile_features(pfr_corename_${testname} PUBLIC cxx_std_20)
target_link_libraries(pfr_corename_${testname} Boost::pfr) target_link_libraries(pfr_corename_${testname} Boost::pfr)
target_include_directories(pfr_corename_${testname} PRIVATE ../../../) target_include_directories(pfr_corename_${testname} PRIVATE ../../../)
add_test(NAME pfr_corename_${testname} COMMAND pfr_corename_${testname}) add_test(NAME pfr_corename_${testname} COMMAND pfr_corename_${testname})
add_dependencies(tests pfr_corename_${testname})
endforeach() endforeach()