From 0d11658ae943902e1067ba4c7d29e5ba8a78218b Mon Sep 17 00:00:00 2001 From: Artem Sheptunov <106321977+Infindery@users.noreply.github.com> Date: Fri, 26 Sep 2025 16:34:15 +0500 Subject: [PATCH 1/2] refactor(gtest): #40: move the test connection stage --- CMakeLists.txt | 4 +++- test/CMakeLists.txt | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3df4917..f61829c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,4 +35,6 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_OBJECTS} ) -add_subdirectory(test) +# Tests +enable_testing() +add_subdirectory(test) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f8c1bfd..a25a440 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,3 @@ -enable_testing() - include(GoogleTest) set(TEST_PROJECT ${PROJECT_NAME}_unit_tests) From 0bcf54004a09c613c1e220075d434f8d8767109b Mon Sep 17 00:00:00 2001 From: Artem Sheptunov <106321977+Infindery@users.noreply.github.com> Date: Fri, 26 Sep 2025 16:34:53 +0500 Subject: [PATCH 2/2] refactor(gtest): #40: correct of typo in package directive --- test/test_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_main.cpp b/test/test_main.cpp index 341c9ed..8a7df25 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -1,10 +1,10 @@ #include "addition-operation.h" -#include "gtest/gtest.h" +#include // Testing reference section in GTest documentation // https://google.github.io/googletest/reference/testing.html TEST(MathTest, AdditionOperation) -{ +{ // Assertions section in GTest documentation // https://google.github.io/googletest/reference/assertions.html#EXPECT_EQ EXPECT_EQ(AdditionOperation(2, 3), 5);