mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 04:53:34 +08:00
Add unit test for dynamically loading modules on posix.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
px4_add_module(
|
||||
MODULE platforms__posix__tests__dyn_hello
|
||||
MAIN hello
|
||||
SRCS
|
||||
hello.cpp
|
||||
DEPENDS
|
||||
DYNAMIC
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <px4_log.h>
|
||||
#include <px4_app.h>
|
||||
|
||||
extern "C" __EXPORT int hello_main(int argc, char *argv[]);
|
||||
int hello_main(int argc, char *argv[])
|
||||
{
|
||||
PX4_INFO("Hello, I am a dynamically loaded module.");
|
||||
|
||||
PX4_INFO("Argv:");
|
||||
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
PX4_INFO(" %d: %s", i, argv[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user