Commit Graph

18 Commits

Author SHA1 Message Date
Ville Juven 6cb2c176d5 events: Move implementation of events::send() to lib/events
Events have a global, system-wide sequence number, which must be handled
atomically, (fetching and incrementing the sequence AND sending the event
to uORB must be atomic). Currently in FLAT mode, only one instance of this
sequence number exists, so it is OK to have it in px4_platform.

However, in PROTECTED mode px4_platform is instantiated both in kernel-
and user spaces, which makes two instances of this sequence number, which
causes problems in the mavlink event handling logic.

When mavlink receives and handles events, it expects that:
- The sequence numbers arrive in order (seq n is followed by n+1 etc)
- It increments by 1
- There is only one instance of the sequence number

In PROTECTED mode this is violated, as the kernel and user sequence
numbers run freely on their own. This patch fixes the issue by moving
the event backend to the kernel and by providing user access to it via
ioctl.
2023-09-25 09:54:11 +02:00
Matthias Grob da0e40c72b googletest: switch to latest version 1.12.1 -> 1.13 2023-03-21 15:01:26 +01:00
Beat Küng 3e68870547 gtest: update to version 1.12.1
Fixes the error
googletest-src/googletest/src/gtest-death-test.cc:1283:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
with GCC 11
2022-08-08 07:43:42 +02:00
Beat Küng 10f49c99ef px4_add_gtest.cmake: add optional COMPILE_FLAGS, INCLUDES, EXTRA_SRCS and LINKLIBS 2021-12-10 09:03:08 -05:00
Daniel Agar ab0d0fd0be
uORB move to PX4 platform layer 2021-02-17 11:25:56 -05:00
RomanBapst e536868104 Add GeofenceBreachAvoidance class
Signed-off-by: Julian Kent <julian@auterion.com>
2021-01-13 10:26:10 +01:00
Matthias Grob d60e1e2774 ControlMath: switch to gtest for unit tessting 2019-10-23 17:33:47 +02:00
Daniel Agar fb7521eb5e cmake px4_base -> px4_parse_function_args 2019-09-15 14:36:38 -04:00
Julian Kent ddd4181b39 Don't run each functional test in a different process 2019-08-21 14:53:41 +02:00
Julian Kent 63140f1d61 Do a single setup of uORB/Parameters instead of once every test 2019-08-21 14:53:41 +02:00
Julian Kent d70b024ec7
GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore

* Add test stubs

* Rename px4_add_gtest to px4_add_unit_gtest

* Add infrastructure to run functional tests

* Add example tests with parameters and uorb messages

* Fix memory issues in destructors in uORB manager and CDev

* Add a more real-world test of the collision prevention
2019-08-09 15:10:09 +02:00
Matthias Grob cbd230e34e Testing: Clean up unit_test target because test_results does all tests now 2019-05-09 09:42:46 +02:00
Matthias Grob 5a90382cb8 sitl_tests: add prefix "sitl-" for regex test filtering 2019-05-09 09:42:46 +02:00
Matthias Grob 5020dfdc3d Testing: switch unit tests to BUILD_TESTING 2019-05-09 09:42:46 +02:00
Matthias Grob f5f95635b4 gtest: fix poisoned exit in compile flags
visibility.h is included globally in PX4 via cmake compile flags.
It contains poisoning the exit() command which is used by gtest
to close the test application. Removing the flag for gtest compilation
fixes the compile error:
gtest.cc:4757:7: error: attempt to use poisoned "exit"
2019-05-09 09:42:46 +02:00
Matthias Grob 8eb0d66279 gtest: download specific version 2019-05-09 09:42:46 +02:00
Matthias Grob 0ff64bf101 Improve ctest unit test naming and filtering 2019-05-09 09:42:46 +02:00
Matthias Grob 63b967f5df Add unit testing possibility using googletest on POSIX 2019-05-09 09:42:46 +02:00