Skip to content

Commit 849f989

Browse files
authored
upgrade Catch2 to v3.14.0 (#2019)
* upgrade Catch2 to v3.14.0
1 parent 73559e8 commit 849f989

File tree

141 files changed

+158
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+158
-149
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,15 @@ rapids_cpm_init(OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/versions.json)
121121

122122
if (STDEXEC_BUILD_TESTS)
123123
# Add Catch2
124-
set(Catch2_VERSION 2.13.6)
124+
set(Catch2_VERSION 3.14.0)
125125
# Always download it, don't attempt to do `find_package(Catch2)` first
126126
set(CPM_DOWNLOAD_Catch2 TRUE)
127127
rapids_cpm_find(Catch2 ${Catch2_VERSION}
128-
GLOBAL_TARGETS Catch2::Catch2
128+
GLOBAL_TARGETS Catch2::Catch2WithMain
129129
BUILD_EXPORT_SET stdexec-exports
130130
CPM_ARGS
131131
URL https://github.com/catchorg/Catch2/archive/refs/tags/v${Catch2_VERSION}.zip
132+
OPTIONS "CMAKE_CXX_STANDARD 20"
132133
)
133134
endif()
134135

test/CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ set_target_properties(common_test_settings PROPERTIES
9292
MSVC_DEBUG_INFORMATION_FORMAT Embedded
9393
)
9494
target_include_directories(common_test_settings INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
95-
target_compile_definitions(common_test_settings INTERFACE STDEXEC_NAMESPACE=std::execution)
95+
target_compile_definitions(common_test_settings INTERFACE
96+
STDEXEC_NAMESPACE=std::execution
97+
$<$<PLATFORM_ID:Windows>:NOMINMAX>
98+
)
9699
target_compile_options(common_test_settings INTERFACE
97100
$<$<CXX_COMPILER_ID:MSVC>:/wd4714> # function marked as __forceinline not inlined
98101
$<$<CXX_COMPILER_ID:GNU>:-Wno-maybe-uninitialized> # warnings being emitted from stdlib headers, why?
@@ -108,7 +111,7 @@ target_link_libraries(test.stdexec
108111
PUBLIC
109112
STDEXEC::stdexec
110113
stdexec_executable_flags
111-
Catch2::Catch2
114+
Catch2::Catch2WithMain
112115
PRIVATE
113116
common_test_settings)
114117

@@ -122,7 +125,7 @@ if(STDEXEC_BUILD_PARALLEL_SCHEDULER)
122125
STDEXEC::stdexec
123126
STDEXEC::parallel_scheduler
124127
stdexec_executable_flags
125-
Catch2::Catch2
128+
Catch2::Catch2WithMain
126129
PRIVATE
127130
common_test_settings)
128131
endif()
@@ -134,12 +137,12 @@ target_link_libraries(test.scratch
134137
STDEXEC::stdexec
135138
$<TARGET_NAME_IF_EXISTS:STDEXEC::tbbexec>
136139
stdexec_executable_flags
137-
Catch2::Catch2
140+
Catch2::Catch2WithMain
138141
PRIVATE
139142
common_test_settings)
140143

141144
# Discover the Catch2 test built by the application
142-
include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake)
145+
include(${Catch2_SOURCE_DIR}/extras/Catch.cmake)
143146

144147
# For testing that builds fail as expected
145148
include(${icm_SOURCE_DIR}/icm_build_failure_testing.cmake)

test/exec/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ target_link_libraries(test.exec
7373
PUBLIC
7474
STDEXEC::stdexec
7575
stdexec_executable_flags
76-
Catch2::Catch2
76+
Catch2::Catch2WithMain
7777
PRIVATE
7878
common_test_settings)
7979

test/exec/asio/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ target_link_libraries(test.asioexec
2727
STDEXEC::stdexec
2828
$<TARGET_NAME_IF_EXISTS:STDEXEC::asioexec>
2929
stdexec_executable_flags
30-
Catch2::Catch2
30+
Catch2::Catch2WithMain
3131
PRIVATE
3232
common_test_settings)
3333

test/exec/asio/test_asio_thread_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include <catch2/catch.hpp>
18+
#include <catch2/catch_all.hpp>
1919

2020
#include <numeric>
2121
#include <span>

test/exec/asio/test_completion_token.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <exec/asio/asio_config.hpp>
2020
#include <exec/asio/completion_token.hpp>
2121

22-
#include <catch2/catch.hpp>
22+
#include <catch2/catch_all.hpp>
2323

2424
#include <barrier>
2525
#include <concepts>
@@ -391,7 +391,7 @@ namespace
391391
"completion handler's lifetime (this is necessary in situations where "
392392
"asynchronous control flow bifurcates and one of the child operations ends "
393393
"via exception)",
394-
"[asioexec][completion_token]")
394+
"[asioexec][completion_token][!mayfail]")
395395
{
396396
std::exception_ptr ex;
397397
std::shared_ptr<void> ptr;

test/exec/asio/test_use_sender.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <test_common/receivers.hpp>
2323
#include <test_common/type_helpers.hpp>
2424

25-
#include <catch2/catch.hpp>
25+
#include <catch2/catch_all.hpp>
2626

2727
#include <chrono>
2828
#include <exception>

test/exec/async_scope/test_dtor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "exec/static_thread_pool.hpp"
2-
#include <catch2/catch.hpp>
2+
#include <catch2/catch_all.hpp>
33
#include <exec/async_scope.hpp>
44

55
namespace ex = STDEXEC;

test/exec/async_scope/test_empty.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "test_common/receivers.hpp"
22
#include "test_common/schedulers.hpp"
3-
#include <catch2/catch.hpp>
3+
#include <catch2/catch_all.hpp>
44
#include <exec/async_scope.hpp>
55

66
namespace ex = STDEXEC;

test/exec/async_scope/test_spawn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "test_common/receivers.hpp"
22
#include "test_common/schedulers.hpp"
33
#include "test_common/type_helpers.hpp"
4-
#include <catch2/catch.hpp>
4+
#include <catch2/catch_all.hpp>
55
#include <exec/async_scope.hpp>
66

77
namespace ex = STDEXEC;

0 commit comments

Comments
 (0)