Skip to content

Commit 7e8ee25

Browse files
Pancakemnashif
authored andcommitted
tests: posix: common: separate posix rwlocks tests into a standalone test
posix.common contains testsuites that can be separated into smaller groups of tests. This change moves rwlocks into a singular testsuite at tests/posix/rwlocks app directory. Signed-off-by: Marvin Ouma <[email protected]>
1 parent f7633a5 commit 7e8ee25

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

tests/posix/rwlocks/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(posix_rw_locks)
6+
7+
target_sources(app PRIVATE src/main.c)
8+
9+
target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)

tests/posix/rwlocks/prj.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_POSIX_API=y
2+
CONFIG_ZTEST=y
3+
4+
CONFIG_POSIX_AEP_CHOICE_BASE=y
5+
CONFIG_POSIX_READER_WRITER_LOCKS=y

tests/posix/common/src/rwlock.c renamed to tests/posix/rwlocks/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void *thread_top(void *p1)
4747
return NULL;
4848
}
4949

50-
ZTEST(rwlock, test_rw_lock)
50+
ZTEST(posix_rw_locks, test_rw_lock)
5151
{
5252
int ret;
5353
pthread_t newthread[N_THR];
@@ -133,12 +133,12 @@ static void test_pthread_rwlockattr_pshared_common(bool set, int pshared)
133133
zassert_ok(pthread_rwlockattr_destroy(&attr));
134134
}
135135

136-
ZTEST(rwlock, test_pthread_rwlockattr_getpshared)
136+
ZTEST(posix_rw_locks, test_pthread_rwlockattr_getpshared)
137137
{
138138
test_pthread_rwlockattr_pshared_common(false, 0);
139139
}
140140

141-
ZTEST(rwlock, test_pthread_rwlockattr_setpshared)
141+
ZTEST(posix_rw_locks, test_pthread_rwlockattr_setpshared)
142142
{
143143
test_pthread_rwlockattr_pshared_common(true, PTHREAD_PROCESS_PRIVATE);
144144
test_pthread_rwlockattr_pshared_common(true, PTHREAD_PROCESS_SHARED);
@@ -154,4 +154,4 @@ static void before(void *arg)
154154
}
155155
}
156156

157-
ZTEST_SUITE(rwlock, NULL, NULL, before, NULL, NULL);
157+
ZTEST_SUITE(posix_rw_locks, NULL, NULL, before, NULL, NULL);

tests/posix/rwlocks/testcase.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
common:
2+
filter: not CONFIG_NATIVE_LIBC
3+
tags:
4+
- posix
5+
- rwlocks
6+
# 1 tier0 platform per supported architecture
7+
platform_key:
8+
- arch
9+
- simulation
10+
tests:
11+
portability.posix.rwlocks:
12+
min_flash: 64
13+
min_ram: 32
14+
portability.posix.rwlocks.minimal:
15+
extra_configs:
16+
- CONFIG_MINIMAL_LIBC=y
17+
portability.posix.rwlocks.newlib:
18+
filter: TOOLCHAIN_HAS_NEWLIB == 1
19+
extra_configs:
20+
- CONFIG_NEWLIB_LIBC=y
21+
- CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=8192
22+
portability.posix.rwlocks.picolibc:
23+
tags: picolibc
24+
filter: CONFIG_PICOLIBC_SUPPORTED
25+
extra_configs:
26+
- CONFIG_PICOLIBC=y

0 commit comments

Comments
 (0)