mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 09:26:25 +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:
@@ -36,4 +36,4 @@ set(SRCS
|
||||
)
|
||||
|
||||
px4_add_library(gtest_functional_main ${SRCS})
|
||||
target_link_libraries(gtest_functional_main PUBLIC gtest)
|
||||
target_link_libraries(gtest_functional_main PUBLIC gtest fuzztest::init_fuzztest)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <fuzztest/init_fuzztest.h>
|
||||
|
||||
#include <uORB/Subscription.hpp>
|
||||
|
||||
@@ -41,6 +42,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
|
||||
fuzztest::ParseAbslFlags(argc, argv);
|
||||
fuzztest::InitFuzzTest(&argc, &argv);
|
||||
|
||||
uORB::Manager::initialize();
|
||||
param_init();
|
||||
return RUN_ALL_TESTS();
|
||||
|
||||
Reference in New Issue
Block a user