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:
Beat Küng
2025-06-16 11:50:20 +02:00
parent 6daec07bbe
commit 3d1cace7b7
13 changed files with 69 additions and 116 deletions
@@ -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();