Skip to content

Commit 4fd9ad6

Browse files
authored
build(tests): #40: linking the cmake tools extension to the test executable
2 parents fb3231a + 0bcf540 commit 4fd9ad6

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
3535
${PROJECT_OBJECTS}
3636
)
3737

38-
add_subdirectory(test)
38+
# Tests
39+
enable_testing()
40+
add_subdirectory(test)

test/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
enable_testing()
2-
31
include(GoogleTest)
42

53
set(TEST_PROJECT ${PROJECT_NAME}_unit_tests)

test/test_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include "addition-operation.h"
2-
#include "gtest/gtest.h"
2+
#include <gtest/gtest.h>
33

44
// Testing reference section in GTest documentation
55
// https://google.github.io/googletest/reference/testing.html
66
TEST(MathTest, AdditionOperation)
7-
{
7+
{
88
// Assertions section in GTest documentation
99
// https://google.github.io/googletest/reference/assertions.html#EXPECT_EQ
1010
EXPECT_EQ(AdditionOperation(2, 3), 5);

0 commit comments

Comments
 (0)