Skip to content

Commit 9fa1019

Browse files
committed
tests: posix: rwlocks: ensure test is not skipped
Commit 7e8ee25 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>
1 parent 61f1411 commit 9fa1019

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

tests/posix/rwlocks/prj.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ CONFIG_ZTEST=y
33

44
CONFIG_POSIX_AEP_CHOICE_BASE=y
55
CONFIG_POSIX_READER_WRITER_LOCKS=y
6+
7+
CONFIG_DYNAMIC_THREAD=y
8+
CONFIG_DYNAMIC_THREAD_POOL_SIZE=3
9+
CONFIG_THREAD_STACK_INFO=y

tests/posix/rwlocks/src/main.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,4 @@ ZTEST(posix_rw_locks, test_pthread_rwlockattr_setpshared)
144144
test_pthread_rwlockattr_pshared_common(true, PTHREAD_PROCESS_SHARED);
145145
}
146146

147-
static void before(void *arg)
148-
{
149-
ARG_UNUSED(arg);
150-
151-
if (!IS_ENABLED(CONFIG_DYNAMIC_THREAD)) {
152-
/* skip redundant testing if there is no thread pool / heap allocation */
153-
ztest_test_skip();
154-
}
155-
}
156-
157-
ZTEST_SUITE(posix_rw_locks, NULL, NULL, before, NULL, NULL);
147+
ZTEST_SUITE(posix_rw_locks, NULL, NULL, NULL, NULL, NULL);

0 commit comments

Comments
 (0)