Skip to content
Snippets Groups Projects
Commit a6c71d85 authored by Sam Yates's avatar Sam Yates
Browse files

Use one gtest lib for test subdirectories

parent b313a6b4
Branches
Tags
No related merge requests found
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
#add_subdirectory(regression) #add_subdirectory(regression)
# google test framework # google test framework
# This fails with lots of undefined reference to `testing::UnitTest::Run()' add_library(gtest gtest-all.cpp)
#add_library(GTEST gtest-all.cpp gtest.h)
# tests look for gtest.h here
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# Unit tests # Unit tests
add_subdirectory(unit) add_subdirectory(unit)
......
...@@ -8,9 +8,6 @@ set(HEADERS ...@@ -8,9 +8,6 @@ set(HEADERS
${PROJECT_SOURCE_DIR}/src/tree.hpp ${PROJECT_SOURCE_DIR}/src/tree.hpp
) )
# google test framework
add_library(gtest gtest-all.cpp gtest.h)
set(TEST_SOURCES set(TEST_SOURCES
# unit tests # unit tests
test_algorithms.cpp test_algorithms.cpp
......
...@@ -23,9 +23,6 @@ set(VALIDATION_SOURCES ...@@ -23,9 +23,6 @@ set(VALIDATION_SOURCES
validate.cpp validate.cpp
) )
# google test framework
add_library(gtest_validate gtest-all.cpp gtest.h)
add_definitions("-DDATADIR=\"${CMAKE_SOURCE_DIR}/data\"") add_definitions("-DDATADIR=\"${CMAKE_SOURCE_DIR}/data\"")
add_executable(validate.exe ${VALIDATION_SOURCES} ${HEADERS}) add_executable(validate.exe ${VALIDATION_SOURCES} ${HEADERS})
...@@ -33,7 +30,7 @@ add_executable(validate.exe ${VALIDATION_SOURCES} ${HEADERS}) ...@@ -33,7 +30,7 @@ add_executable(validate.exe ${VALIDATION_SOURCES} ${HEADERS})
set(TARGETS validate.exe) set(TARGETS validate.exe)
foreach(target ${TARGETS}) foreach(target ${TARGETS})
target_link_libraries(${target} LINK_PUBLIC cellalgo gtest_validate) target_link_libraries(${target} LINK_PUBLIC cellalgo gtest)
if(WITH_TBB) if(WITH_TBB)
target_link_libraries(${target} LINK_PUBLIC ${TBB_LIBRARIES}) target_link_libraries(${target} LINK_PUBLIC ${TBB_LIBRARIES})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment