tests: posix: rwlocks: ensure test is not skipped
Commit 7e8ee25479
moved the tests for the
POSIX_RW_LOCKS Option Group from the tests/posix/common testsuite to
its own dedicated testsuite.
However, there was a copy-paste error. Previously, tests would have been
run only once when dynamic threads were enabled, and then skipped when
dynamic threads were disabled, since that follows the posix programming
model better. However, dynamic threads were never actually enabled after
moving to the new testsuite. So all tests were effectively skipped.
Add the necessary options to prj.conf in order to ensure that there are
sufficient dynamic threads available to run the testsuite.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
parent
706770b50f
commit
89dd0ef1c1
2 changed files with 6 additions and 11 deletions
|
@ -3,3 +3,7 @@ CONFIG_ZTEST=y
|
|||
|
||||
CONFIG_POSIX_AEP_CHOICE_BASE=y
|
||||
CONFIG_POSIX_READER_WRITER_LOCKS=y
|
||||
|
||||
CONFIG_DYNAMIC_THREAD=y
|
||||
CONFIG_DYNAMIC_THREAD_POOL_SIZE=3
|
||||
CONFIG_THREAD_STACK_INFO=y
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <zephyr/ztest.h>
|
||||
|
||||
#define N_THR 3
|
||||
BUILD_ASSERT(N_THR <= CONFIG_DYNAMIC_THREAD_POOL_SIZE, "Insufficient number of dynamic threads");
|
||||
|
||||
LOG_MODULE_REGISTER(posix_rwlock_test);
|
||||
|
||||
|
@ -144,14 +145,4 @@ ZTEST(posix_rw_locks, test_pthread_rwlockattr_setpshared)
|
|||
test_pthread_rwlockattr_pshared_common(true, PTHREAD_PROCESS_SHARED);
|
||||
}
|
||||
|
||||
static void before(void *arg)
|
||||
{
|
||||
ARG_UNUSED(arg);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_DYNAMIC_THREAD)) {
|
||||
/* skip redundant testing if there is no thread pool / heap allocation */
|
||||
ztest_test_skip();
|
||||
}
|
||||
}
|
||||
|
||||
ZTEST_SUITE(posix_rw_locks, NULL, NULL, before, NULL, NULL);
|
||||
ZTEST_SUITE(posix_rw_locks, NULL, NULL, NULL, NULL, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue