Commit be738e7f by Maarten L. Hekkelman

catch22

parent 9c78131d
...@@ -79,7 +79,7 @@ struct regex_impl : public regex ...@@ -79,7 +79,7 @@ struct regex_impl : public regex
DDL_PrimitiveType map_to_primitive_type(std::string_view s, std::error_code &ec) noexcept DDL_PrimitiveType map_to_primitive_type(std::string_view s, std::error_code &ec) noexcept
{ {
ec = {}; ec = {};
DDL_PrimitiveType result; DDL_PrimitiveType result = DDL_PrimitiveType::Char;
if (iequals(s, "char")) if (iequals(s, "char"))
result = DDL_PrimitiveType::Char; result = DDL_PrimitiveType::Char;
else if (iequals(s, "uchar")) else if (iequals(s, "uchar"))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
find_package(Catch2 QUIET) find_package(Catch2 QUIET)
if (NOT Catch2_FOUND) if(NOT Catch2_FOUND)
FetchContent_Declare( FetchContent_Declare(
Catch2 Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_REPOSITORY https://github.com/catchorg/Catch2.git
...@@ -30,13 +30,12 @@ add_library(test-main OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/test-main.cpp") ...@@ -30,13 +30,12 @@ add_library(test-main OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/test-main.cpp")
target_link_libraries(test-main cifpp::cifpp Catch2::Catch2) target_link_libraries(test-main cifpp::cifpp Catch2::Catch2)
if(${Catch2_VERSION} VERSION_GREATER_EQUAL "3.0.0") if(${Catch2_VERSION} VERSION_GREATER_EQUAL 3.0.0)
target_compile_definitions(test-main PUBLIC CATCH22=0) target_compile_definitions(test-main PUBLIC CATCH22=0)
else() else()
target_compile_definitions(test-main PUBLIC CATCH22=1) target_compile_definitions(test-main PUBLIC CATCH22=1)
endif() endif()
foreach(CIFPP_TEST IN LISTS CIFPP_tests) foreach(CIFPP_TEST IN LISTS CIFPP_tests)
set(CIFPP_TEST "${CIFPP_TEST}-test") set(CIFPP_TEST "${CIFPP_TEST}-test")
set(CIFPP_TEST_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${CIFPP_TEST}.cpp") set(CIFPP_TEST_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${CIFPP_TEST}.cpp")
...@@ -44,6 +43,12 @@ foreach(CIFPP_TEST IN LISTS CIFPP_tests) ...@@ -44,6 +43,12 @@ foreach(CIFPP_TEST IN LISTS CIFPP_tests)
add_executable( add_executable(
${CIFPP_TEST} ${CIFPP_TEST_SOURCE} $<TARGET_OBJECTS:test-main>) ${CIFPP_TEST} ${CIFPP_TEST_SOURCE} $<TARGET_OBJECTS:test-main>)
if(${Catch2_VERSION} VERSION_GREATER_EQUAL 3.0.0)
target_compile_definitions(${CIFPP_TEST} PUBLIC CATCH22=0)
else()
target_compile_definitions(${CIFPP_TEST} PUBLIC CATCH22=1)
endif()
target_link_libraries(${CIFPP_TEST} PRIVATE Threads::Threads cifpp::cifpp target_link_libraries(${CIFPP_TEST} PRIVATE Threads::Threads cifpp::cifpp
Catch2::Catch2) Catch2::Catch2)
target_include_directories(${CIFPP_TEST} PRIVATE "${EIGEN_INCLUDE_DIR}") target_include_directories(${CIFPP_TEST} PRIVATE "${EIGEN_INCLUDE_DIR}")
......
#define CATCH_CONFIG_RUNNER 1
#include "test-main.hpp" #include "test-main.hpp"
#include <cif++.hpp> #include <cif++.hpp>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment