Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
"tests": [
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror",
"Debug.Coverage", "Debug.-DBEMAN_EXPECTED_USE_MODULES=On"
"Debug.Coverage", "Debug.-DBEMAN_EXPECTED_USE_MODULES=On",
"Debug.-DCMAKE_CXX_FLAGS=-freflection"
]
}
]
Expand Down
80 changes: 80 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,28 @@
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/gnu-toolchain.cmake"
}
},
{
"name": "gcc-16-debug",
"displayName": "GCC 16 Debug Build (C++26, reflection)",
"inherits": [
"_root-config"
],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/gcc-16-toolchain.cmake"
}
},
{
"name": "gcc-16-release",
"displayName": "GCC 16 Release Build (C++26, reflection)",
"inherits": [
"_root-config",
"_release-base"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/gcc-16-toolchain.cmake"
}
},
{
"name": "llvm-debug",
"displayName": "Clang Debug Build",
Expand Down Expand Up @@ -172,6 +194,20 @@
"_root-build"
]
},
{
"name": "gcc-16-debug",
"configurePreset": "gcc-16-debug",
"inherits": [
"_root-build"
]
},
{
"name": "gcc-16-release",
"configurePreset": "gcc-16-release",
"inherits": [
"_root-build"
]
},
{
"name": "llvm-debug",
"configurePreset": "llvm-debug",
Expand Down Expand Up @@ -237,6 +273,16 @@
"inherits": "_test_base",
"configurePreset": "gcc-release"
},
{
"name": "gcc-16-debug",
"inherits": "_test_base",
"configurePreset": "gcc-16-debug"
},
{
"name": "gcc-16-release",
"inherits": "_test_base",
"configurePreset": "gcc-16-release"
},
{
"name": "llvm-debug",
"inherits": "_test_base",
Expand Down Expand Up @@ -303,6 +349,40 @@
}
]
},
{
"name": "gcc-16-debug",
"steps": [
{
"type": "configure",
"name": "gcc-16-debug"
},
{
"type": "build",
"name": "gcc-16-debug"
},
{
"type": "test",
"name": "gcc-16-debug"
}
]
},
{
"name": "gcc-16-release",
"steps": [
{
"type": "configure",
"name": "gcc-16-release"
},
{
"type": "build",
"name": "gcc-16-release"
},
{
"type": "test",
"name": "gcc-16-release"
}
]
},
{
"name": "llvm-debug",
"steps": [
Expand Down
1 change: 1 addition & 0 deletions tests/beman/expected/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ set(beman_expected_beman_only_tests
expected_review_corrections.test.cpp
expected_smf_regressions.test.cpp
header_idempotence.test.cpp
type_name.test.cpp
)

include(Catch)
Expand Down
26 changes: 26 additions & 0 deletions tests/beman/expected/type_name.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// tests/beman/expected/type_name.test.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Beman-only: a compiler with reflection gets the reflection implementation of
// testing/type_name.hpp.
//
// The selection needs both the compiler's __cpp_impl_reflection and the
// library's __cpp_lib_reflection, and falling back is silent: every other test
// still passes using the fallback. So whenever the compiler has reflection,
// check that it was used. A build that forces an implementation with
// BEMAN_EXPECTED_TESTING_TYPE_NAME_USE_REFLECTION has made its own choice, and
// is not second-guessed.

#if defined(BEMAN_EXPECTED_TESTING_TYPE_NAME_USE_REFLECTION)
#define BEMAN_EXPECTED_TESTING_TYPE_NAME_FORCED
#endif

#include <catch2/catch_test_macros.hpp>

#include <beman/expected/testing/type_name.hpp>

#if defined(__cpp_impl_reflection) && !defined(BEMAN_EXPECTED_TESTING_TYPE_NAME_FORCED)
TEST_CASE("type_name: a compiler with reflection gets the reflection implementation", "[type_name]") {
CHECK(BEMAN_EXPECTED_TESTING_TYPE_NAME_USE_REFLECTION == 1);
}
#endif
Loading