From 238e0fc583919e44b7a1c8dcacb0eaa0eafecd9b Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Tue, 24 Oct 2023 18:09:26 -0700 Subject: [PATCH] Update Catch2 to v3.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without upgrading Catch2, The following error occurs when building on Ubuntu 22.04 due to glibc: cucim/build-debug/_deps/deps-catch2-src/single_include/catch2/ catch.hpp:10830:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’ 10830 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; Signed-off-by: Gigon Bae --- cpp/cmake/deps/catch2.cmake | 7 ++++--- cpp/plugins/cucim.kit.cumed/cmake/deps/catch2.cmake | 7 ++++--- cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt | 6 +++--- cpp/plugins/cucim.kit.cumed/tests/main.cpp | 7 ++++--- cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp | 2 +- cpp/plugins/cucim.kit.cuslide/cmake/deps/catch2.cmake | 7 ++++--- cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt | 6 +++--- cpp/plugins/cucim.kit.cuslide/tests/main.cpp | 7 ++++--- cpp/plugins/cucim.kit.cuslide/tests/test_philips_tiff.cpp | 2 +- cpp/plugins/cucim.kit.cuslide/tests/test_read_rawtiff.cpp | 2 +- cpp/plugins/cucim.kit.cuslide/tests/test_read_region.cpp | 3 ++- cpp/tests/CMakeLists.txt | 6 +++--- cpp/tests/main.cpp | 7 ++++--- cpp/tests/test_cufile.cpp | 2 +- cpp/tests/test_metadata.cpp | 2 +- cpp/tests/test_read_region.cpp | 2 +- notebooks/File-access_Experiments_on_TIFF.ipynb | 2 +- 17 files changed, 42 insertions(+), 35 deletions(-) diff --git a/cpp/cmake/deps/catch2.cmake b/cpp/cmake/deps/catch2.cmake index f5e9ca616..4ee4bfabd 100644 --- a/cpp/cmake/deps/catch2.cmake +++ b/cpp/cmake/deps/catch2.cmake @@ -17,7 +17,7 @@ if (NOT TARGET deps::catch2) FetchContent_Declare( deps-catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.1 + GIT_TAG v3.4.0 GIT_SHALLOW TRUE ) FetchContent_GetProperties(deps-catch2) @@ -29,8 +29,9 @@ if (NOT TARGET deps::catch2) add_subdirectory(${deps-catch2_SOURCE_DIR} ${deps-catch2_BINARY_DIR} EXCLUDE_FROM_ALL) - # Include Append catch2's cmake module path so that we can use `include(ParseAndAddCatchTests)`. - list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/contrib") + # Include Append catch2's cmake module path so that we can use `include(Catch)`. + # https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake + list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/extras") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE) add_library(deps::catch2 INTERFACE IMPORTED GLOBAL) diff --git a/cpp/plugins/cucim.kit.cumed/cmake/deps/catch2.cmake b/cpp/plugins/cucim.kit.cumed/cmake/deps/catch2.cmake index 0872d67bb..6a35a9c0b 100644 --- a/cpp/plugins/cucim.kit.cumed/cmake/deps/catch2.cmake +++ b/cpp/plugins/cucim.kit.cumed/cmake/deps/catch2.cmake @@ -17,7 +17,7 @@ if (NOT TARGET deps::catch2) FetchContent_Declare( deps-catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.1 + GIT_TAG v3.4.0 GIT_SHALLOW TRUE ) FetchContent_GetProperties(deps-catch2) @@ -29,8 +29,9 @@ if (NOT TARGET deps::catch2) add_subdirectory(${deps-catch2_SOURCE_DIR} ${deps-catch2_BINARY_DIR} EXCLUDE_FROM_ALL) - # Include Append catch2's cmake module path so that we can use `include(ParseAndAddCatchTests)`. - list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/contrib") + # Include Append catch2's cmake module path so that we can use `include(Catch)`. + # https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake + list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/extras") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE) add_library(deps::catch2 INTERFACE IMPORTED GLOBAL) diff --git a/cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt b/cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt index 95df56068..262c02499 100644 --- a/cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt +++ b/cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt @@ -57,6 +57,6 @@ target_include_directories(cumed_tests $ ) -include(ParseAndAddCatchTests) -# See https://github.com/catchorg/Catch2/blob/master/docs/cmake-integration.md#parseandaddcatchtestscmake for other options -ParseAndAddCatchTests(cumed_tests) +include(Catch) +# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options +catch_discover_tests(cumed_tests) diff --git a/cpp/plugins/cucim.kit.cumed/tests/main.cpp b/cpp/plugins/cucim.kit.cumed/tests/main.cpp index aa02e0309..1a24e09b5 100644 --- a/cpp/plugins/cucim.kit.cumed/tests/main.cpp +++ b/cpp/plugins/cucim.kit.cumed/tests/main.cpp @@ -14,15 +14,16 @@ * limitations under the License. */ -//#define CATCH_CONFIG_MAIN -//#include +// #define CATCH_CONFIG_MAIN +// #include // Implement main explicitly to handle additional parameters. #define CATCH_CONFIG_RUNNER #include "config.h" #include "cucim/core/framework.h" -#include +#include +#include #include #include diff --git a/cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp b/cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp index 1191db58e..bb7178e3f 100644 --- a/cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp +++ b/cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp @@ -16,7 +16,7 @@ #include "config.h" -#include +#include #include TEST_CASE("Verify file", "[test_basic.cpp]") diff --git a/cpp/plugins/cucim.kit.cuslide/cmake/deps/catch2.cmake b/cpp/plugins/cucim.kit.cuslide/cmake/deps/catch2.cmake index f5e9ca616..4ee4bfabd 100644 --- a/cpp/plugins/cucim.kit.cuslide/cmake/deps/catch2.cmake +++ b/cpp/plugins/cucim.kit.cuslide/cmake/deps/catch2.cmake @@ -17,7 +17,7 @@ if (NOT TARGET deps::catch2) FetchContent_Declare( deps-catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.1 + GIT_TAG v3.4.0 GIT_SHALLOW TRUE ) FetchContent_GetProperties(deps-catch2) @@ -29,8 +29,9 @@ if (NOT TARGET deps::catch2) add_subdirectory(${deps-catch2_SOURCE_DIR} ${deps-catch2_BINARY_DIR} EXCLUDE_FROM_ALL) - # Include Append catch2's cmake module path so that we can use `include(ParseAndAddCatchTests)`. - list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/contrib") + # Include Append catch2's cmake module path so that we can use `include(Catch)`. + # https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake + list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/extras") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE) add_library(deps::catch2 INTERFACE IMPORTED GLOBAL) diff --git a/cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt b/cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt index c779d63b8..3b9bde713 100644 --- a/cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt +++ b/cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt @@ -60,6 +60,6 @@ target_include_directories(cuslide_tests $ ) -include(ParseAndAddCatchTests) -# See https://github.com/catchorg/Catch2/blob/master/docs/cmake-integration.md#parseandaddcatchtestscmake for other options -ParseAndAddCatchTests(cuslide_tests) +include(Catch) +# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options +catch_discover_tests(cuslide_tests) diff --git a/cpp/plugins/cucim.kit.cuslide/tests/main.cpp b/cpp/plugins/cucim.kit.cuslide/tests/main.cpp index 0f4e3f544..ad3b4f883 100644 --- a/cpp/plugins/cucim.kit.cuslide/tests/main.cpp +++ b/cpp/plugins/cucim.kit.cuslide/tests/main.cpp @@ -14,15 +14,16 @@ * limitations under the License. */ -//#define CATCH_CONFIG_MAIN -//#include +// #define CATCH_CONFIG_MAIN +// #include // Implement main explicitly to handle additional parameters. #define CATCH_CONFIG_RUNNER #include "config.h" #include "cucim/core/framework.h" -#include +#include +#include #include #include diff --git a/cpp/plugins/cucim.kit.cuslide/tests/test_philips_tiff.cpp b/cpp/plugins/cucim.kit.cuslide/tests/test_philips_tiff.cpp index 974ed85ea..82fb5ddb7 100644 --- a/cpp/plugins/cucim.kit.cuslide/tests/test_philips_tiff.cpp +++ b/cpp/plugins/cucim.kit.cuslide/tests/test_philips_tiff.cpp @@ -19,7 +19,7 @@ #include "cuslide/tiff/tiff.h" #include "config.h" -#include +#include #include TEST_CASE("Verify philips tiff file", "[test_philips_tiff.cpp]") diff --git a/cpp/plugins/cucim.kit.cuslide/tests/test_read_rawtiff.cpp b/cpp/plugins/cucim.kit.cuslide/tests/test_read_rawtiff.cpp index 54f4801ac..819e801c5 100644 --- a/cpp/plugins/cucim.kit.cuslide/tests/test_read_rawtiff.cpp +++ b/cpp/plugins/cucim.kit.cuslide/tests/test_read_rawtiff.cpp @@ -19,7 +19,7 @@ #include "config.h" #include -#include +#include #include #include #include diff --git a/cpp/plugins/cucim.kit.cuslide/tests/test_read_region.cpp b/cpp/plugins/cucim.kit.cuslide/tests/test_read_region.cpp index b28c6c78b..af808fd12 100644 --- a/cpp/plugins/cucim.kit.cuslide/tests/test_read_region.cpp +++ b/cpp/plugins/cucim.kit.cuslide/tests/test_read_region.cpp @@ -16,7 +16,8 @@ #include -#include +#include +#include #include #include diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 2e892875b..dfd619b24 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -60,6 +60,6 @@ target_link_libraries(cucim_tests Threads::Threads # -lpthread ) -include(ParseAndAddCatchTests) -# See https://github.com/catchorg/Catch2/blob/master/docs/cmake-integration.md#parseandaddcatchtestscmake for other options -ParseAndAddCatchTests(cucim_tests) +include(Catch) +# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options +catch_discover_tests(cucim_tests) diff --git a/cpp/tests/main.cpp b/cpp/tests/main.cpp index bdcdf1f43..07705522b 100644 --- a/cpp/tests/main.cpp +++ b/cpp/tests/main.cpp @@ -14,15 +14,16 @@ * limitations under the License. */ -//#define CATCH_CONFIG_MAIN -//#include +// #define CATCH_CONFIG_MAIN +// #include // Implement main explicitly to handle additional parameters. #define CATCH_CONFIG_RUNNER #include "config.h" #include "cucim/core/framework.h" -#include +#include +#include #include #include diff --git a/cpp/tests/test_cufile.cpp b/cpp/tests/test_cufile.cpp index a1330d52b..35c0c31a3 100644 --- a/cpp/tests/test_cufile.cpp +++ b/cpp/tests/test_cufile.cpp @@ -17,7 +17,7 @@ #include "cucim/logger/timer.h" #include "config.h" -#include +#include #include #include #include diff --git a/cpp/tests/test_metadata.cpp b/cpp/tests/test_metadata.cpp index 59a7057f6..537094ece 100644 --- a/cpp/tests/test_metadata.cpp +++ b/cpp/tests/test_metadata.cpp @@ -20,7 +20,7 @@ #include "cucim/core/framework.h" #include "cucim/io/format/image_format.h" -#include +#include #include #include #include diff --git a/cpp/tests/test_read_region.cpp b/cpp/tests/test_read_region.cpp index 95fa43b85..7b8fa80f9 100644 --- a/cpp/tests/test_read_region.cpp +++ b/cpp/tests/test_read_region.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include diff --git a/notebooks/File-access_Experiments_on_TIFF.ipynb b/notebooks/File-access_Experiments_on_TIFF.ipynb index 9ebbf59cd..8f11c9f72 100644 --- a/notebooks/File-access_Experiments_on_TIFF.ipynb +++ b/notebooks/File-access_Experiments_on_TIFF.ipynb @@ -199,7 +199,7 @@ "#include \"cuslide/tiff/tiff.h\"\n", "#include \"config.h\"\n", "\n", - "#include \n", + "#include \n", "#include \n", "#include \n", "#include \n",