File tree Expand file tree Collapse file tree 3 files changed +52
-49
lines changed
Expand file tree Collapse file tree 3 files changed +52
-49
lines changed Original file line number Diff line number Diff line change @@ -28,26 +28,29 @@ target_sources(
2828)
2929
3030if (OPTIONAL_ENABLE_TESTING)
31- find_package (GTest QUIET )
32- if (GTest_FOUND)
33- # Create the library target and named header set for testing beman_optional
34- # and mark the set private
35- add_executable (beman_optional_test)
36- target_sources (
37- beman_optional_test
38- PRIVATE
39- FILE_SET beman_optional_test_headers
40- TYPE HEADERS
41- BASE_DIRS tests
42- )
43- # Tests
44- add_subdirectory (tests/beman/optional )
45- else ()
46- message (WARNING "
31+ find_package (GTest QUIET )
32+ if (GTest_FOUND)
33+ # Create the library target and named header set for testing beman_optional
34+ # and mark the set private
35+ add_executable (beman_optional_test)
36+ target_sources (
37+ beman_optional_test
38+ PRIVATE
39+ FILE_SET beman_optional_test_headers
40+ TYPE HEADERS
41+ BASE_DIRS tests
42+ )
43+ # Tests
44+ add_subdirectory (tests/beman/optional )
45+ else ()
46+ message (
47+ WARNING
48+ "
4749No provider for GTest. Unable to build tests.
4850Consider using CMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/use-fetch-content.cmake as documented in the README.md
49- " )
50- endif ()
51+ "
52+ )
53+ endif ()
5154endif ()
5255
5356add_subdirectory (include /beman/optional )
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ function(BemanOptional_provideDependency method package_name)
149149 "to FetchContent logic fetching ${BemanOptional_repo} at "
150150 "${BemanOptional_tag} according to ${BemanOptional_lockfile} ."
151151 )
152- message (STATUS "${BemanOptional_debug} " )
152+ message (STATUS "${BemanOptional_debug} " )
153153 FetchContent_Declare(
154154 "${BemanOptional_name} "
155155 GIT_REPOSITORY "${BemanOptional_repo} "
Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44# cmake-format: on
55
6- target_sources(
7- beman_optional_test
8- PRIVATE
9- optional.t.cpp
10- optional_constexpr.t.cpp
11- optional_monadic.t.cpp
12- optional_range_support.t.cpp
13- optional_ref.t.cpp
14- optional_ref_monadic.t.cpp
15- )
16-
17- target_sources(
18- beman_optional_test
19- PRIVATE
20- FILE_SET beman_optional_test_headers
21- TYPE HEADERS
22- FILES test_types.hpp test_utilities.hpp
23- )
24-
25- target_link_libraries(
26- beman_optional_test
27- PRIVATE beman_optional GTest ::gtest GTest::gtest_main
28- )
29- # Issue #32: Re-enable ASAN run CI/clang-19.
30- #
31- # Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some
32- # platforms. Temporary switch to gtest_add_tests and skip some Asan checks.
33- # Change also applied for CI flows.
34- include (GoogleTest)
35- gtest_add_tests(TARGET beman_optional_test "" AUTO)
6+ target_sources(
7+ beman_optional_test
8+ PRIVATE
9+ optional.t.cpp
10+ optional_constexpr.t.cpp
11+ optional_monadic.t.cpp
12+ optional_range_support.t.cpp
13+ optional_ref.t.cpp
14+ optional_ref_monadic.t.cpp
15+ )
16+
17+ target_sources(
18+ beman_optional_test
19+ PRIVATE
20+ FILE_SET beman_optional_test_headers
21+ TYPE HEADERS
22+ FILES test_types.hpp test_utilities.hpp
23+ )
24+
25+ target_link_libraries(
26+ beman_optional_test
27+ PRIVATE beman_optional GTest ::gtest GTest::gtest_main
28+ )
29+ # Issue #32: Re-enable ASAN run CI/clang-19.
30+ #
31+ # Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some
32+ # platforms. Temporary switch to gtest_add_tests and skip some Asan checks.
33+ # Change also applied for CI flows.
34+ include (GoogleTest)
35+ gtest_add_tests(TARGET beman_optional_test "" AUTO)
3636
3737add_library(constructor_fails test_constructor_fail.cpp)
3838
You can’t perform that action at this time.
0 commit comments