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 <pancakesdeath@protonmail.com>
diff --git a/tests/posix/xsi_streams/CMakeLists.txt b/tests/posix/xsi_streams/CMakeLists.txt
new file mode 100644
index 0000000..33c8e50
--- /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 0000000..6a39c38
--- /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 84%
rename from tests/posix/common/src/stropts.c
rename to tests/posix/xsi_streams/src/main.c
index 9dcf899..ff66585 100644
--- a/tests/posix/common/src/stropts.c
+++ b/tests/posix/xsi_streams/src/main.c
@@ -7,7 +7,7 @@
#include <stropts.h>
#include <errno.h>
-ZTEST(stropts, test_putmsg)
+ZTEST(xsi_streams, test_putmsg)
{
const struct strbuf *ctrl = NULL;
const struct strbuf *data = NULL;
@@ -18,7 +18,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 0000000..c039596
--- /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