Add unit testing possibility using googletest on POSIX

This commit is contained in:
Matthias Grob
2019-03-02 18:18:00 +01:00
parent 816aa0ffb6
commit 63b967f5df
8 changed files with 164 additions and 2 deletions

View File

@@ -413,6 +413,20 @@ if (NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
endforeach()
endif()
#=============================================================================
# Testing - Automatic unit and integration testing with CTest
#
option(unit_testing "Configure unit test targets" OFF)
list(APPEND CMAKE_MODULE_PATH ${PX4_SOURCE_DIR}/cmake/gtest/)
include(px4_add_gtest)
if(unit_testing)
include(gtest)
add_custom_target(unit_test COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} -V -R Test USES_TERMINAL)
endif()
#=============================================================================
# subdirectories
#