diff --git a/CMakeLists.txt b/CMakeLists.txt index a382ace..5f3bfcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,42 +74,18 @@ if (OPTIONAL_BUILD_TESTS) set(CATCH_BUILD_TESTING OFF) set(CATCH_INSTALL_DOCS OFF) FetchContent_Declare(Catch2 URL - https://github.com/catchorg/Catch2/archive/v2.9.2.zip) + https://github.com/catchorg/Catch2/archive/v3.6.0.zip) FetchContent_MakeAvailable(Catch2) - file(GENERATE OUTPUT catch.main.cpp - CONTENT [[ - #define CATCH_CONFIG_MAIN - #include - ]]) - set_property(SOURCE ${PROJECT_BINARY_DIR}/catch.main.cpp - PROPERTY - GENERATED ON) - add_library(${PROJECT_NAME}-catch-main OBJECT) - target_sources(${PROJECT_NAME}-catch-main PRIVATE - ${PROJECT_BINARY_DIR}/catch.main.cpp) - target_compile_options(${PROJECT_NAME}-catch-main - PUBLIC - $<$,$>:-stdlib=libc++> - $<$>:-Wall -Wextra>) - target_link_options(${PROJECT_NAME}-catch-main - PUBLIC - $<$,$>:-stdlib=libc++>) - target_link_libraries(${PROJECT_NAME}-catch-main - PUBLIC - Catch2::Catch2 - optional) - file(GLOB test-sources CONFIGURE_DEPENDS tests/*.cpp) foreach (source IN LISTS test-sources) get_filename_component(name "${source}" NAME_WE) set(test "${PROJECT_NAME}-test-${name}") add_executable(${test} - "${source}" - $) + "${source}") target_link_libraries(${test} PRIVATE - ${PROJECT_NAME}-catch-main) + Catch2::Catch2WithMain optional) add_test(NAME ${PROJECT_NAME}::test::${name} COMMAND ${test}) endforeach() endif() diff --git a/tests/assignment.cpp b/tests/assignment.cpp index 145f894..2ad55b1 100644 --- a/tests/assignment.cpp +++ b/tests/assignment.cpp @@ -1,4 +1,4 @@ -#include +#include #include TEST_CASE("Assignment value", "[assignment.value]") { diff --git a/tests/bases.cpp b/tests/bases.cpp index 0261ee6..fc970e9 100644 --- a/tests/bases.cpp +++ b/tests/bases.cpp @@ -1,4 +1,4 @@ -#include +#include #include // Old versions of GCC don't have the correct trait names. Could fix them up if needs be. diff --git a/tests/constexpr.cpp b/tests/constexpr.cpp index 1f8ca4c..6297eff 100644 --- a/tests/constexpr.cpp +++ b/tests/constexpr.cpp @@ -1,4 +1,4 @@ -#include +#include #include TEST_CASE("Constexpr", "[constexpr]") { diff --git a/tests/constructors.cpp b/tests/constructors.cpp index 6199c9f..c57e247 100644 --- a/tests/constructors.cpp +++ b/tests/constructors.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/emplace.cpp b/tests/emplace.cpp index 051096d..1486757 100644 --- a/tests/emplace.cpp +++ b/tests/emplace.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/tests/extensions.cpp b/tests/extensions.cpp index 1ca0423..ebf80ec 100644 --- a/tests/extensions.cpp +++ b/tests/extensions.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/hash.cpp b/tests/hash.cpp index 967a08f..5608181 100644 --- a/tests/hash.cpp +++ b/tests/hash.cpp @@ -1,4 +1,4 @@ -#include +#include #include TEST_CASE("Hashing", "[hash]") {} diff --git a/tests/in_place.cpp b/tests/in_place.cpp index f267d04..f8ae5ba 100644 --- a/tests/in_place.cpp +++ b/tests/in_place.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/issues.cpp b/tests/issues.cpp index 85b7c6e..722340e 100644 --- a/tests/issues.cpp +++ b/tests/issues.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/make_optional.cpp b/tests/make_optional.cpp index 0ba542b..82c44fb 100644 --- a/tests/make_optional.cpp +++ b/tests/make_optional.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/noexcept.cpp b/tests/noexcept.cpp index 949650b..4e87331 100644 --- a/tests/noexcept.cpp +++ b/tests/noexcept.cpp @@ -1,4 +1,4 @@ -#include +#include #include TEST_CASE("Noexcept", "[noexcept]") { diff --git a/tests/nullopt.cpp b/tests/nullopt.cpp index 7c29c39..e033e24 100644 --- a/tests/nullopt.cpp +++ b/tests/nullopt.cpp @@ -1,4 +1,4 @@ -#include +#include #include TEST_CASE("Nullopt", "[nullopt]") { diff --git a/tests/observers.cpp b/tests/observers.cpp index afb3e25..01079f5 100644 --- a/tests/observers.cpp +++ b/tests/observers.cpp @@ -1,4 +1,4 @@ -#include +#include #include struct move_detector { diff --git a/tests/relops.cpp b/tests/relops.cpp index 04823d6..61fab20 100644 --- a/tests/relops.cpp +++ b/tests/relops.cpp @@ -1,4 +1,4 @@ -#include +#include #include TEST_CASE("Relational ops", "[relops]") { diff --git a/tests/swap.cpp b/tests/swap.cpp index 2210d97..6aef43c 100644 --- a/tests/swap.cpp +++ b/tests/swap.cpp @@ -1,4 +1,4 @@ -#include +#include #include TEST_CASE("Swap value", "[swap.value]") {