zephyr/tests/kernel/threads
Andy Ross 904a6c0319 tests/thread_apis: Fix whitebox assumptions in runtime_stats test
The thread_apis tests of the RUNTIME_STATS feature weren't really
testing the right behavior.

+ It assumed that accounting would only happen at context switch time
  and required that the returned values not change for running threads
  (even CLEARLY running threads like _current!).  But that's not a
  documented feature!  It's actually sort of a wart that we'd like to
  be able to fix (and have fixed, the new backend returns realtime
  values so you can track CPU-bound processes on another CPU).

+ It assumed that k_thread_runtime_stats_all_get() would return time
  that includes idle time (or conversely it forgot that
  k_thread_foreach enumerates over idle threads).  This was sort of a
  bug in the original (because it means that the result is always the
  system uptime multiplied by the number of CPUs)

Broadly, instead of testing the result of a "time" function for
equality (never a good idea) test it via appropriate bounds given the
usage.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-11-08 21:32:20 -05:00
..
dynamic_thread
no-multithreading
thread_apis tests/thread_apis: Fix whitebox assumptions in runtime_stats test 2021-11-08 21:32:20 -05:00
thread_error_case
thread_init
thread_stack tests: threads: fix kernel/thread_stack test 2021-09-27 12:25:12 -04:00
tls