nuttx-apps icon indicating copy to clipboard operation
nuttx-apps copied to clipboard

testing/ostest: add hrtimer API functional tests

Open wangchdo opened this issue 1 month ago • 2 comments

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

wangchdo avatar Dec 15 '25 13:12 wangchdo

@anchao @cederom @simbit18

tests updated according to updated in https://github.com/apache/nuttx/pull/17573

wangchdo avatar Dec 16 '25 02:12 wangchdo

@anchao @cederom @xiaoxiang781216 @linguini1 @simbit18

HRTimer tests have been updated according to @xiaoxiang781216's comments. The improvements include:

  1. Fixed typos.
  2. Enabled the HRTimer tests to run repeatedly.
  3. 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.

wangchdo avatar Dec 17 '25 05:12 wangchdo