Skip to content

Commit

Permalink
Update Catch2 to v3.4.0
Browse files Browse the repository at this point in the history
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 <gbae@nvidia.com>
  • Loading branch information
gigony committed Oct 27, 2023
1 parent d489bb3 commit 238e0fc
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 35 deletions.
7 changes: 4 additions & 3 deletions cpp/cmake/deps/catch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cumed/cmake/deps/catch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ target_include_directories(cumed_tests
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../src>
)

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)
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cumed/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
* limitations under the License.
*/

//#define CATCH_CONFIG_MAIN
//#include <catch2/catch.hpp>
// #define CATCH_CONFIG_MAIN
// #include <catch2/catch_test_macros.hpp>

// Implement main explicitly to handle additional parameters.
#define CATCH_CONFIG_RUNNER
#include "config.h"
#include "cucim/core/framework.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_session.hpp>
#include <string>
#include <fmt/format.h>

Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "config.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <chrono>

TEST_CASE("Verify file", "[test_basic.cpp]")
Expand Down
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cuslide/cmake/deps/catch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ target_include_directories(cuslide_tests
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../src>
)

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)
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cuslide/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
* limitations under the License.
*/

//#define CATCH_CONFIG_MAIN
//#include <catch2/catch.hpp>
// #define CATCH_CONFIG_MAIN
// #include <catch2/catch_test_macros.hpp>

// Implement main explicitly to handle additional parameters.
#define CATCH_CONFIG_RUNNER
#include "config.h"
#include "cucim/core/framework.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_session.hpp>
#include <string>
#include <fmt/format.h>

Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cuslide/tests/test_philips_tiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "cuslide/tiff/tiff.h"
#include "config.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <chrono>

TEST_CASE("Verify philips tiff file", "[test_philips_tiff.cpp]")
Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cuslide/tests/test_read_rawtiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "config.h"

#include <cuda_runtime.h>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fmt/format.h>
#include <cucim/filesystem/cufile_driver.h>
#include <cstdlib>
Expand Down
3 changes: 2 additions & 1 deletion cpp/plugins/cucim.kit.cuslide/tests/test_read_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

#include <chrono>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <openslide/openslide.h>

#include <cucim/memory/memory_manager.h>
Expand Down
6 changes: 3 additions & 3 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 4 additions & 3 deletions cpp/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
* limitations under the License.
*/

//#define CATCH_CONFIG_MAIN
//#include <catch2/catch.hpp>
// #define CATCH_CONFIG_MAIN
// #include <catch2/catch_test_macros.hpp>

// Implement main explicitly to handle additional parameters.
#define CATCH_CONFIG_RUNNER
#include "config.h"
#include "cucim/core/framework.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_session.hpp>
#include <string>
#include <fmt/format.h>

Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/test_cufile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "cucim/logger/timer.h"
#include "config.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fmt/format.h>
#include <cucim/filesystem/cufile_driver.h>
#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/test_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "cucim/core/framework.h"
#include "cucim/io/format/image_format.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fmt/format.h>
#include <chrono>
#include <cstdlib>
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/test_read_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <chrono>
#include <iostream>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <cuda_runtime.h>
#include <openslide/openslide.h>

Expand Down
2 changes: 1 addition & 1 deletion notebooks/File-access_Experiments_on_TIFF.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"#include \"cuslide/tiff/tiff.h\"\n",
"#include \"config.h\"\n",
"\n",
"#include <catch2/catch.hpp>\n",
"#include <catch2/catch_test_macros.hpp>\n",
"#include <fmt/format.h>\n",
"#include <cucim/filesystem/cufile_driver.h>\n",
"#include <cstdlib>\n",
Expand Down

0 comments on commit 238e0fc

Please sign in to comment.