Skip to content

Commit 4b5ae9e

Browse files
committed
tests: posix: semaphores: ensure test is not skipped
Commit f7633a5 moved the tests for the POSIX_SEMAPHORES 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 <[email protected]>
1 parent ece1c2d commit 4b5ae9e

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

tests/posix/semaphores/prj.conf

+4
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_SEMAPHORES=y
6+
7+
CONFIG_DYNAMIC_THREAD=y
8+
CONFIG_DYNAMIC_THREAD_POOL_SIZE=2
9+
CONFIG_THREAD_STACK_INFO=y

tests/posix/semaphores/src/main.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,4 @@ ZTEST(posix_semaphores, test_named_semaphore)
310310
zassert_equal(nsem_get_list_len(), 0);
311311
}
312312

313-
static void before(void *arg)
314-
{
315-
ARG_UNUSED(arg);
316-
317-
if (!IS_ENABLED(CONFIG_DYNAMIC_THREAD)) {
318-
/* skip redundant testing if there is no thread pool / heap allocation */
319-
ztest_test_skip();
320-
}
321-
}
322-
323-
ZTEST_SUITE(posix_semaphores, NULL, NULL, before, NULL, NULL);
313+
ZTEST_SUITE(posix_semaphores, NULL, NULL, NULL, NULL, NULL);

0 commit comments

Comments
 (0)