zephyr/tests/kernel/timer/timer_behavior
Nicolas Pitre 141299fb80 tests: timer_behavior: better cope with timer wrap-arounds
Commit a1d21ca69b ("tests: timer_behavior: don't fail the test with
timer wrap-arounds") simply ignored the total time validation whenever
any rollover was detected. Let's adjust the end timestamp according
to the number of rollovers instead.

Documentation for sys_clock_cycle_get_32() says it should count up
monotonically through the full 32 bit space, wrapping at 0xffffffff.
Therefore we just need to add 2^32 times the number of rollovers to
the end timestamp.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-18 21:36:57 +00:00
..
src tests: timer_behavior: better cope with timer wrap-arounds 2023-07-18 21:36:57 +00:00
CMakeLists.txt
Kconfig tests: timer_behavior: Use bigger drift tolerance for nRF RTC timer 2023-06-12 14:04:42 -04:00
prj.conf tests: kernel: timer_behavior: improve timer_tick_train output 2023-02-19 20:34:37 -05:00
README
testcase.yaml samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00

# Test a timer implementations variance and long term drift

Records and calculates statistical values against a timer validating that.

1. Timer variance and standard deviation is below defined acceptable values.
2. Periodic timers do not drift in either direction from expected total time.

Timers are meant to be precise and accurate. This test validates an implementation is both.