File tree Expand file tree Collapse file tree 4 files changed +9
-25
lines changed Expand file tree Collapse file tree 4 files changed +9
-25
lines changed Original file line number Diff line number Diff line change 1- include (FetchContent)
2-
3- FetchContent_Declare(
4- googletest
5- GIT_REPOSITORY https://github.com/google/googletest.git
6- GIT_TAG v1.15.2
7- )
8-
9- # For Windows: Prevent overriding the parent project's compiler/linker settings
10- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
11- FetchContent_MakeAvailable(googletest)
12-
131enable_testing ()
142
153add_executable (
164 ${PROJECT_NAME} _tests
175 main_test.cpp
186 unit_tests.cpp
197 test_functions.cpp
20- test_functions.hpp
21- ProjectIntegrationTestSuite.cpp
22- ProjectIntegrationTestSuite.hpp
8+ test_suites/ProjectIntegrationTestSuite.cpp
239)
2410
2511target_link_libraries (
26- ${PROJECT_NAME} _tests # link used libraries from lib directory
12+ ${PROJECT_NAME} _tests
2713 ui
2814 mylib
2915 GTest::gtest_main
3016)
3117
32- if (NOT CMAKE_BUILD_TYPE )
33- set (CMAKE_BUILD_TYPE Debug) # Tests should be built with Debug
34- endif ()
35-
3618message (STATUS "Tests build type: ${CMAKE_BUILD_TYPE} " )
3719
3820target_include_directories (${PROJECT_NAME} _tests PUBLIC ${PROJECT_SOURCE_DIR} )
3921
4022include (GoogleTest)
4123
42- gtest_discover_tests(${PROJECT_NAME} _tests)
24+ gtest_discover_tests(${PROJECT_NAME} _tests)
Original file line number Diff line number Diff line change 1+ #include < filesystem>
12#include < sstream>
23
34#include < gtest/gtest.h>
4- #include " ProjectIntegrationTestSuite.hpp"
5- #include " test_functions.hpp"
65#include " lib/ui/ui_functions.hpp" // include your library here
6+ #include " test_functions.hpp"
7+ #include " test_suites/ProjectIntegrationTestSuite.hpp"
78
89TEST_F (ProjectIntegrationTestSuite, InitTest) {
910 ASSERT_TRUE (std::filesystem::is_directory (kTemporaryDirectoryName ));
Original file line number Diff line number Diff line change 1+ #include < filesystem>
2+
13#include " ProjectIntegrationTestSuite.hpp"
24
35void ProjectIntegrationTestSuite::SetUp () {
Original file line number Diff line number Diff line change 11#ifndef TEMPORARYDIRECTORYTESTSUITE_HPP_
22#define TEMPORARYDIRECTORYTESTSUITE_HPP_
33
4- #include < filesystem>
54#include < string>
65
76#include < gtest/gtest.h>
@@ -14,4 +13,4 @@ struct ProjectIntegrationTestSuite : public testing::Test { // special test stru
1413 void TearDown () override ; // method that is called at the end of every test
1514};
1615
17- #endif // TEMPORARYDIRECTORYTESTSUITE_HPP_
16+ #endif // TEMPORARYDIRECTORYTESTSUITE_HPP_
You can’t perform that action at this time.
0 commit comments