diff --git a/CMakeLists.txt b/CMakeLists.txt index 3824815..49aa8ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,9 @@ if(BUILD_TESTING) enable_testing() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -coverage") - find_package(googletest REQUIRED) + find_package(Catch2 REQUIRED) add_executable(result_test test/result_test.cpp) - target_link_libraries(result_test PRIVATE gtest_main) - gtest_discover_tests(result_test) + target_link_libraries(result_test PRIVATE Catch2::Catch2WithMain) + catch_discover_tests(result_test) endif() diff --git a/cmake/FindCatch2.cmake b/cmake/FindCatch2.cmake new file mode 100644 index 0000000..f62abe0 --- /dev/null +++ b/cmake/FindCatch2.cmake @@ -0,0 +1,8 @@ +if(Catch2_FOUND) + return() +endif() + +include(CPM) +CPMAddPackage("gh:catchorg/Catch2@3.2.0") + +include("${Catch2_SOURCE_DIR}/extras/Catch.cmake") diff --git a/cmake/Findgoogletest.cmake b/cmake/Findgoogletest.cmake deleted file mode 100644 index b099b01..0000000 --- a/cmake/Findgoogletest.cmake +++ /dev/null @@ -1,13 +0,0 @@ -if(googletest_FOUND) - return() -endif() - -include(CPM) - -CPMAddPackage( - NAME googletest - GITHUB_REPOSITORY google/googletest - GIT_TAG release-1.12.1 -) - -include(GoogleTest) diff --git a/test/result_test.cpp b/test/result_test.cpp index b2fab19..538da0a 100644 --- a/test/result_test.cpp +++ b/test/result_test.cpp @@ -1,5 +1,5 @@ -#include +#include -TEST(ResultTest, Dummy) { - EXPECT_TRUE(true); +TEST_CASE("example test") { + REQUIRE(true); }