From d11488608ffe48d1a2398aea60c065e8d6b20098 Mon Sep 17 00:00:00 2001 From: Marvin Ouma Date: Tue, 5 Nov 2024 19:33:31 +0300 Subject: [PATCH] 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 --- tests/posix/rwlocks/CMakeLists.txt | 12 ++++++++++ tests/posix/rwlocks/prj.conf | 6 +++++ tests/posix/{common => rwlocks}/src/rwlock.c | 0 tests/posix/rwlocks/testcase.yaml | 25 ++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 tests/posix/rwlocks/CMakeLists.txt create mode 100644 tests/posix/rwlocks/prj.conf rename tests/posix/{common => rwlocks}/src/rwlock.c (100%) create mode 100644 tests/posix/rwlocks/testcase.yaml diff --git a/tests/posix/rwlocks/CMakeLists.txt b/tests/posix/rwlocks/CMakeLists.txt new file mode 100644 index 000000000000000..65eab095ff48d5b --- /dev/null +++ b/tests/posix/rwlocks/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(posix_rw_locks) + +FILE(GLOB app_sources src/*.c) +zephyr_include_directories(${ZEPHYR_BASE}/lib/posix) + +target_sources(app PRIVATE ${app_sources}) + +target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L) diff --git a/tests/posix/rwlocks/prj.conf b/tests/posix/rwlocks/prj.conf new file mode 100644 index 000000000000000..5212fc7b40663ab --- /dev/null +++ b/tests/posix/rwlocks/prj.conf @@ -0,0 +1,6 @@ +CONFIG_POSIX_API=y +CONFIG_ZTEST=y + +CONFIG_POSIX_AEP_CHOICE_PSE51=y +CONFIG_POSIX_READER_WRITER_LOCKS=y +CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/tests/posix/common/src/rwlock.c b/tests/posix/rwlocks/src/rwlock.c similarity index 100% rename from tests/posix/common/src/rwlock.c rename to tests/posix/rwlocks/src/rwlock.c diff --git a/tests/posix/rwlocks/testcase.yaml b/tests/posix/rwlocks/testcase.yaml new file mode 100644 index 000000000000000..45b8b5ff2bbc570 --- /dev/null +++ b/tests/posix/rwlocks/testcase.yaml @@ -0,0 +1,25 @@ +common: + filter: not CONFIG_NATIVE_LIBC + tags: + - posix + - rwlocks + # 1 tier0 platform per supported architecture + platform_key: + - arch + - simulation +tests: + portability.posix.rwlocks: + min_flash: 64 + min_ram: 32 + portability.posix.rwlocks.minimal: + extra_configs: + - CONFIG_MINIMAL_LIBC=y + portability.posix.rwlocks.newlib: + filter: TOOLCHAIN_HAS_NEWLIB == 1 + extra_configs: + - CONFIG_NEWLIB_LIBC=y + portability.posix.rwlocks.picolibc: + tags: picolibc + filter: CONFIG_PICOLIBC_SUPPORTED + extra_configs: + - CONFIG_PICOLIBC=y