ztest: fix ztest thread priority in cooperative mode

By default ztest thread is running at the priority `-1`. This value is
invalid when the testcase is running in cooperative mode only. Set
default ztest thread priority to `-2` if this is the case. The fix is
modeled on the approach used to define the default
`MAIN_THREAD_PRIORITY`.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
Piotr Mienkowski 2021-03-07 21:39:52 +01:00 committed by Kumar Gala
commit 41c10d4f66

View file

@ -33,6 +33,7 @@ config ZTEST_ASSERT_VERBOSE
config ZTEST_THREAD_PRIORITY config ZTEST_THREAD_PRIORITY
int "Testing thread priority" int "Testing thread priority"
default -2 if !PREEMPT_ENABLED
default -1 default -1
help help
Set priority of the testing thread. Default is -1 (cooperative). Set priority of the testing thread. Default is -1 (cooperative).