Skip to content
Permalink
Browse files

ztest: make priority of testing thread configurable

CONFIG_ZTEST_THREAD_PRIORITY can be now used to modify
the ztest thread priority.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
  • Loading branch information...
masz-nordic authored and nashif committed Apr 5, 2019
1 parent 3ffdcf4 commit ad17e41be67841a384f5698e57d3fb320e583771
Showing with 9 additions and 2 deletions.
  1. +7 −0 subsys/testsuite/ztest/Kconfig
  2. +2 −2 subsys/testsuite/ztest/src/ztest.c
@@ -47,3 +47,10 @@ config ZTEST_PARAMETER_COUNT
default 1
help
Maximum amount of concurrent return values / expected parameters.

config ZTEST_THREAD_PRIORITY
int "Testing thread priority"
depends on ZTEST
default -1
help
Set priority of the testing thread. Default is -1 (cooperative).
@@ -209,8 +209,8 @@ static int run_test(struct unit_test *test)
k_thread_create(&ztest_thread, ztest_thread_stack,
K_THREAD_STACK_SIZEOF(ztest_thread_stack),
(k_thread_entry_t) test_cb, (struct unit_test *)test,
NULL, NULL, -1, test->thread_options | K_INHERIT_PERMS,
0);
NULL, NULL, CONFIG_ZTEST_THREAD_PRIORITY,
test->thread_options | K_INHERIT_PERMS, 0);
/*
* There is an implicit expectation here that the thread that was
* spawned is still higher priority than the current thread.

0 comments on commit ad17e41

Please sign in to comment.
You can’t perform that action at this time.