nuttx-apps
nuttx-apps copied to clipboard
testing/ostest: add hrtimer API functional tests
Summary
Add functional tests for the newly added hrtimer APIs, including hrtimer_init(), hrtimer_start(), and hrtimer_cancel().
Impact
This PR depends on https://github.com/apache/nuttx/pull/17489
Testing
ostest passed on a2g-tc397-5v-tft with hrtimer enalbed
NuttShell (NSH)
nsh>
nsh> uname -a
NuttX 0.0.0 eb9dd8afaf Dec 17 2025 13:34:17 tricore a2g-tc397-5v-tft
nsh>
nsh> ostest
(...)
user_main: hrtimer test
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 28dfc 28dfc
ordblks 6 6
mxordblk 1f8a8 1f8a8
uordblks 555c 555c
fordblks 238a0 238a0
Final memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 28dfc 28dfc
ordblks 1 6
mxordblk 24220 1f8a8
uordblks 4bdc 555c
fordblks 24220 238a0
user_main: Exiting
ostest_main: Exiting with status 0
@anchao @cederom @simbit18
tests updated according to updated in https://github.com/apache/nuttx/pull/17573
@anchao @cederom @xiaoxiang781216 @linguini1 @simbit18
HRTimer tests have been updated according to @xiaoxiang781216's comments. The improvements include:
- Fixed typos.
- Enabled the HRTimer tests to run repeatedly.
- Added a tolerance margin in the test checks to improve robustness.
The ostest has passed on real hardware (a2g-tc397-5v-tft) for two consecutive runs.