mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-04 05:38:53 +08:00
add gtest, temp disable swig
(cherry picked from commit 4008d163d77f503e6acbd7ddc1d87ac6d479c897)
This commit is contained in:
committed by
Mathieu Bresciani
parent
9b4b24ee71
commit
fcea13eef8
@@ -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
@@ -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()
|
||||||
|
|||||||
@@ -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();
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
TEST(test_example, sample_test)
|
||||||
|
{
|
||||||
|
printf("blabla \n" );
|
||||||
|
EXPECT_EQ(1, 1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user