-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ntest for unit testing on NuttX #12106
Conversation
This looks promising, I'd just like to see if we can do it without the linking and module ordering hacks. |
Do you have an idea how? Otherwise this will probably rot here. |
FYI @LukasWoodtli |
Note to myself: I should change this to have separate binaries and then list them at build time for the test script to run them using serial: |
1e47372
to
e2c9199
Compare
This adds a small testing library which mimicks gtest to be used on NuttX where we currently can't use the C++ STL.
This adds the ntest runner using the ntestlib. It's a simple harness mimicking the gtest test runner for NuttX.
This adds the ntest systemcmd using ntestlib to the build. This is the equivalent of gtest testing on Posix for NuttX. This works as follows: 1. At cmake configure time all tests are added to global cmake lists. 2. Then when ntest is configured (last), the collected test sources and dependencies are added to the ntest build. When compiling for NuttX we need to include ntestlib.h, when building for Posix we need to include gtest.h (see px4_unittesting.h).
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
As discussed on the dev call we would rather want to use gtest using STL on NuttX in the future, closing. |
This brings the capability to run gtest tests on NuttX.
I looked at various ways to get the gtest tests onto NuttX/Pixhawks:
Currently we support
ASSERT_EQ
,EXPECT_EQ
,ASSERT_TRUE
,EXPECT_TRUE
,ASSERT_FALSE
,EXPECT_FALSE
.The output looks like this for failures:
And if successful: