diff --git a/CMakeLists.txt b/CMakeLists.txt index 93de259..b3a67a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,6 @@ include(cmake/variables.cmake) configure_file(src/config.h.in config.h) -############################### -# XXX DISABLE TESTING FOR NOW # -############################### -set(BUILD_TESTING OFF) - # ---- Declare library ---- add_library( diff --git a/CMakePresets.json b/CMakePresets.json index bb04e4d..e477aef 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -26,7 +26,7 @@ "hidden": true, "inherits": "cmake-pedantic", "cacheVariables": { - "NUTC24_DEVELOPER_MODE": "ON" + "raccoon_DEVELOPER_MODE": "ON" } }, { diff --git a/conanfile.py b/conanfile.py index e3c73ba..da47112 100644 --- a/conanfile.py +++ b/conanfile.py @@ -21,7 +21,7 @@ def requirements(self): self.requires("argparse/2.9") # argument parsing def build_requirements(self): - self.test_requires("catch2/3.3.1") + self.test_requires("gtest/1.13.0") def configure(self): if self.settings.os == 'Windows': diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6cd6bbb..8315066 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,8 +6,8 @@ project(raccoonTests LANGUAGES CXX) # ---- Dependencies ---- -find_package(Catch2 REQUIRED) -include(Catch) +find_package(GTest REQUIRED) +include(GoogleTest) # ---- Tests ---- @@ -15,11 +15,11 @@ add_executable(raccoon_test src/raccoon_test.cpp) target_link_libraries( raccoon_test PRIVATE raccoon_lib - Catch2::Catch2WithMain + GTest::gtest_main ) target_compile_features(raccoon_test PRIVATE cxx_std_20) -catch_discover_tests(raccoon_test) +gtest_discover_tests(raccoon_test) # ---- End-of-file commands ---- diff --git a/test/src/raccoon_test.cpp b/test/src/raccoon_test.cpp index 165863c..eef0077 100644 --- a/test/src/raccoon_test.cpp +++ b/test/src/raccoon_test.cpp @@ -1,3 +1,11 @@ -#include +#include -TEST_CASE("Name is raccoon", "[library]") {} +// Demonstrate some basic assertions. +TEST(HelloTest, BasicAssertions) +{ + // Expect two strings not to be equal. + EXPECT_STRNE("hello", "world"); + + // Expect equality. + EXPECT_EQ(7 * 6, 42); +}