ENH: add testing structure
This commit is contained in:
parent
ea1ef11694
commit
7c78897f19
@ -9,6 +9,7 @@ add_executable(${CMAKE_PROJECT_NAME}_run ${SOURCE_FILES})
|
|||||||
include_directories(src)
|
include_directories(src)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
|
||||||
target_link_libraries(${CMAKE_PROJECT_NAME}_run ${CMAKE_PROJECT_NAME}_lib)
|
target_link_libraries(${CMAKE_PROJECT_NAME}_run ${CMAKE_PROJECT_NAME}_lib)
|
||||||
|
|
||||||
|
8
tests/CMakeLists.txt
Normal file
8
tests/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
project(${CMAKE_PROJECT_NAME}_tests)
|
||||||
|
|
||||||
|
if(NOT EXISTS lib/googletest)
|
||||||
|
file(MAKE_DIRECTORY lib/googletest)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(lib/googletest)
|
||||||
|
add_subdirectory(unit_tests)
|
8
tests/unit_tests/CMakeLists.txt
Normal file
8
tests/unit_tests/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
|
||||||
|
|
||||||
|
add_executable(Unit_Tests_run
|
||||||
|
test_example.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(Unit_Tests_run gtest gtest_main)
|
||||||
|
target_link_libraries(Unit_Tests_run ${CMAKE_PROJECT_NAME}_lib)
|
5
tests/unit_tests/test_example.cpp
Normal file
5
tests/unit_tests/test_example.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
TEST(Example, Equals) {
|
||||||
|
EXPECT_EQ(1, 1);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user