mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-23 18:13:49 +08:00
test: add google fuzztest to unit test build
From https://github.com/google/fuzztest. This will now also add gtest (via cmake FetchContent) And requires newer cmake (container updates): CMake 3.19 or higher is required. You are running version 3.16.3
This commit is contained in:
23
test/CMakeLists.txt
Normal file
23
test/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
px4_add_git_submodule(TARGET git_fuzztest PATH "fuzztest")
|
||||
|
||||
message(STATUS "Adding fuzztest")
|
||||
# This will also add GTest
|
||||
add_subdirectory(fuzztest EXCLUDE_FROM_ALL)
|
||||
|
||||
# Ensure there's no -R without any filter expression since that trips newer ctest versions
|
||||
if(TESTFILTER)
|
||||
set(TESTFILTERARG "-R")
|
||||
else()
|
||||
set(TESTFILTERARG "")
|
||||
endif()
|
||||
|
||||
add_custom_target(test_results
|
||||
# antlr4_tests_NOT_BUILT gets added by fuzztest
|
||||
COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} --output-on-failure -T Test ${TESTFILTERARG} ${TESTFILTER} --exclude-regex "antlr4_tests_NOT_BUILT"
|
||||
DEPENDS
|
||||
px4
|
||||
examples__dyn_hello
|
||||
USES_TERMINAL
|
||||
COMMENT "Running tests"
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR})
|
||||
set_target_properties(test_results PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
||||
1
test/fuzztest
Submodule
1
test/fuzztest
Submodule
Submodule test/fuzztest added at 1e47f9d743
Reference in New Issue
Block a user