Skip to content

Commit

Permalink
tests: posix: common: separate posix xsi streams to standalone test
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Pancakem committed Nov 16, 2024
1 parent 5f418f5 commit 26a057d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
9 changes: 9 additions & 0 deletions tests/posix/xopen_streams/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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(posix_xopen_streams)

FILE(GLOB app_sources src/main.c)

target_sources(app PRIVATE ${app_sources})
5 changes: 5 additions & 0 deletions tests/posix/xopen_streams/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CONFIG_POSIX_API=y
CONFIG_ZTEST=y

CONFIG_POSIX_AEP_CHOICE_BASE=y
CONFIG_XOPEN_STREAMS=y
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stropts.h>
#include <errno.h>

ZTEST(stropts, test_putmsg)
ZTEST(posix_xopen_streams, test_putmsg)
{
const struct strbuf *ctrl = NULL;
const struct strbuf *data = NULL;
Expand All @@ -18,7 +18,7 @@ ZTEST(stropts, test_putmsg)
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
}

ZTEST(stropts, test_fdetach)
ZTEST(posix_xopen_streams, test_fdetach)
{
char *path = NULL;
int ret = fdetach(path);
Expand All @@ -27,7 +27,7 @@ ZTEST(stropts, test_fdetach)
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
}

ZTEST(stropts, test_fattach)
ZTEST(posix_xopen_streams, test_fattach)
{
char *path = NULL;
int fd = -1;
Expand All @@ -37,7 +37,7 @@ ZTEST(stropts, test_fattach)
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
}

ZTEST(stropts, test_getmsg)
ZTEST(posix_xopen_streams, test_getmsg)
{
struct strbuf *ctrl = NULL;
struct strbuf *data = NULL;
Expand All @@ -48,7 +48,7 @@ ZTEST(stropts, test_getmsg)
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
}

ZTEST(stropts, test_getpmsg)
ZTEST(posix_xopen_streams, test_getpmsg)
{
struct strbuf *ctrl = NULL;
struct strbuf *data = NULL;
Expand All @@ -59,7 +59,7 @@ ZTEST(stropts, test_getpmsg)
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
}

ZTEST(stropts, test_isastream)
ZTEST(posix_xopen_streams, test_isastream)
{
int fd = -1;
int ret = isastream(fd);
Expand All @@ -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(posix_xopen_streams, NULL, NULL, NULL, NULL, NULL);
25 changes: 25 additions & 0 deletions tests/posix/xopen_streams/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
common:
filter: not CONFIG_NATIVE_LIBC
tags:
- posix
- xopen_streams
# 1 tier0 platform per supported architecture
platform_key:
- arch
- simulation
min_flash: 64
min_ram: 32
tests:
portability.posix.xopen_streams: {}
portability.posix.xopen_streams.minimal:
extra_configs:
- CONFIG_MINIMAL_LIBC=y
portability.posix.xopen_streams.newlib:
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
portability.posix.xopen_streams.picolibc:
tags: picolibc
filter: CONFIG_PICOLIBC_SUPPORTED
extra_configs:
- CONFIG_PICOLIBC=y

0 comments on commit 26a057d

Please sign in to comment.