add gtest, temp disable swig

(cherry picked from commit 4008d163d77f503e6acbd7ddc1d87ac6d479c897)
This commit is contained in:
Martina Rivizzigno
2019-10-28 11:04:38 +01:00
committed by Mathieu Bresciani
parent 9b4b24ee71
commit fcea13eef8
4 changed files with 41 additions and 12 deletions
+15
View File
@@ -222,3 +222,18 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
endif() endif()
endif() endif()
endif() endif()
enable_testing()
include_directories(${GTEST_INCLUDE_DIR})
add_subdirectory("/usr/src/gtest" ${CMAKE_BINARY_DIR}/gtest)
set(SRCS
test/main.cpp
test/test_example.cpp
)
add_executable(TestECL ${SRCS})
target_include_directories(TestECL PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(TestECL gtest gtest_main)
add_test(NAME TestECL COMMAND TestECL)
+6 -6
View File
@@ -58,10 +58,10 @@ set_target_properties(ecl_EKF PROPERTIES PUBLIC_HEADER "ekf.h")
target_compile_options(ecl_EKF PRIVATE -fno-associative-math) target_compile_options(ecl_EKF PRIVATE -fno-associative-math)
if(EKF_PYTHON_TESTS) #if(EKF_PYTHON_TESTS)
add_subdirectory(swig) # add_subdirectory(swig)
endif() #endif()
if(BUILD_TESTING) #if(BUILD_TESTING)
add_subdirectory(tests) # add_subdirectory(tests)
endif() #endif()
+7
View File
@@ -0,0 +1,7 @@
#include <gtest/gtest.h>
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
std::cout << "init test \n";
return RUN_ALL_TESTS();
}
+7
View File
@@ -0,0 +1,7 @@
#include "gtest/gtest.h"
TEST(test_example, sample_test)
{
printf("blabla \n" );
EXPECT_EQ(1, 1);
}