From 91749dfeb325b0d57488556cd369ba7917d5978f Mon Sep 17 00:00:00 2001 From: Marvin Ouma Date: Fri, 15 Nov 2024 16:43:10 +0300 Subject: [PATCH] tests: posix: common: separate posix xsi streams to standalone test posix.common contains testsuites that can be separated into smaller groups of tests. This change moves stropts into a singular testsuite at tests/posix/xsi_streams app directory. Signed-off-by: Marvin Ouma --- tests/posix/xsi_streams/CMakeLists.txt | 9 +++++++ tests/posix/xsi_streams/prj.conf | 5 ++++ .../src/stropts.c => xsi_streams/src/main.c} | 14 +++++------ tests/posix/xsi_streams/testcase.yaml | 25 +++++++++++++++++++ 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 tests/posix/xsi_streams/CMakeLists.txt create mode 100644 tests/posix/xsi_streams/prj.conf rename tests/posix/{common/src/stropts.c => xsi_streams/src/main.c} (85%) create mode 100644 tests/posix/xsi_streams/testcase.yaml diff --git a/tests/posix/xsi_streams/CMakeLists.txt b/tests/posix/xsi_streams/CMakeLists.txt new file mode 100644 index 00000000000..33c8e509075 --- /dev/null +++ b/tests/posix/xsi_streams/CMakeLists.txt @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(xsi_streams) + +FILE(GLOB app_sources src/main.c) + +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/posix/xsi_streams/prj.conf b/tests/posix/xsi_streams/prj.conf new file mode 100644 index 00000000000..6a39c38d1c6 --- /dev/null +++ b/tests/posix/xsi_streams/prj.conf @@ -0,0 +1,5 @@ +CONFIG_POSIX_API=y +CONFIG_ZTEST=y + +CONFIG_POSIX_AEP_CHOICE_BASE=y +CONFIG_XOPEN_STREAMS=y diff --git a/tests/posix/common/src/stropts.c b/tests/posix/xsi_streams/src/main.c similarity index 85% rename from tests/posix/common/src/stropts.c rename to tests/posix/xsi_streams/src/main.c index 9dcf899ca94..ff665857286 100644 --- a/tests/posix/common/src/stropts.c +++ b/tests/posix/xsi_streams/src/main.c @@ -7,7 +7,7 @@ #include #include -ZTEST(stropts, test_putmsg) +ZTEST(xsi_streams, test_putmsg) { const struct strbuf *ctrl = NULL; const struct strbuf *data = NULL; @@ -18,7 +18,7 @@ ZTEST(stropts, test_putmsg) zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); } -ZTEST(stropts, test_fdetach) +ZTEST(xsi_streams, test_fdetach) { char *path = NULL; int ret = fdetach(path); @@ -27,7 +27,7 @@ ZTEST(stropts, test_fdetach) zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); } -ZTEST(stropts, test_fattach) +ZTEST(xsi_streams, test_fattach) { char *path = NULL; int fd = -1; @@ -37,7 +37,7 @@ ZTEST(stropts, test_fattach) zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); } -ZTEST(stropts, test_getmsg) +ZTEST(xsi_streams, test_getmsg) { struct strbuf *ctrl = NULL; struct strbuf *data = NULL; @@ -48,7 +48,7 @@ ZTEST(stropts, test_getmsg) zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); } -ZTEST(stropts, test_getpmsg) +ZTEST(xsi_streams, test_getpmsg) { struct strbuf *ctrl = NULL; struct strbuf *data = NULL; @@ -59,7 +59,7 @@ ZTEST(stropts, test_getpmsg) zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); } -ZTEST(stropts, test_isastream) +ZTEST(xsi_streams, test_isastream) { int fd = -1; int ret = isastream(fd); @@ -68,4 +68,4 @@ ZTEST(stropts, test_isastream) zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); } -ZTEST_SUITE(stropts, NULL, NULL, NULL, NULL, NULL); +ZTEST_SUITE(xsi_streams, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/posix/xsi_streams/testcase.yaml b/tests/posix/xsi_streams/testcase.yaml new file mode 100644 index 00000000000..c0395960827 --- /dev/null +++ b/tests/posix/xsi_streams/testcase.yaml @@ -0,0 +1,25 @@ +common: + filter: not CONFIG_NATIVE_LIBC + tags: + - posix + - xsi_streams + # 1 tier0 platform per supported architecture + platform_key: + - arch + - simulation + min_flash: 64 + min_ram: 32 +tests: + portability.posix.xsi_streams: {} + portability.posix.xsi_streams.minimal: + extra_configs: + - CONFIG_MINIMAL_LIBC=y + portability.posix.xsi_streams.newlib: + filter: TOOLCHAIN_HAS_NEWLIB == 1 + extra_configs: + - CONFIG_NEWLIB_LIBC=y + portability.posix.xsi_streams.picolibc: + tags: picolibc + filter: CONFIG_PICOLIBC_SUPPORTED + extra_configs: + - CONFIG_PICOLIBC=y