zephyr/tests/kernel/threads/thread_apis
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
..
src tests/thread_apis: Fix whitebox assumptions in runtime_stats test 2021-11-08 21:32:20 -05:00
CMakeLists.txt
prj.conf
testcase.yaml tests/kernel/threads_apis: Add case for CPU_MASK_PIN_ONLY 2021-09-28 20:15:05 -04:00