From 9211abcde6073db59f9bfd898cd43ad16179de11 Mon Sep 17 00:00:00 2001 From: Marvin Ouma Date: Tue, 5 Nov 2024 22:10:47 +0300 Subject: [PATCH] tests: posix: common: separate posix xsi system logging to standalone test posix.common contains testsuites that can be separated into smaller groups of tests. This change moves syslog into a singular testsuite at tests/posix/xsi_system_logging app directory. Signed-off-by: Marvin Ouma --- tests/posix/xsi_system_logging/CMakeLists.txt | 9 +++++++ tests/posix/xsi_system_logging/prj.conf | 5 ++++ .../src/main.c} | 6 ++--- tests/posix/xsi_system_logging/testcase.yaml | 24 +++++++++++++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 tests/posix/xsi_system_logging/CMakeLists.txt create mode 100644 tests/posix/xsi_system_logging/prj.conf rename tests/posix/{common/src/syslog.c => xsi_system_logging/src/main.c} (84%) create mode 100644 tests/posix/xsi_system_logging/testcase.yaml diff --git a/tests/posix/xsi_system_logging/CMakeLists.txt b/tests/posix/xsi_system_logging/CMakeLists.txt new file mode 100644 index 00000000000..d840466ff2c --- /dev/null +++ b/tests/posix/xsi_system_logging/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_system_logging) + +target_sources(app PRIVATE src/main.c) + +target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L) diff --git a/tests/posix/xsi_system_logging/prj.conf b/tests/posix/xsi_system_logging/prj.conf new file mode 100644 index 00000000000..38310f1b1e6 --- /dev/null +++ b/tests/posix/xsi_system_logging/prj.conf @@ -0,0 +1,5 @@ +CONFIG_POSIX_API=y +CONFIG_ZTEST=y + +CONFIG_POSIX_AEP_CHOICE_BASE=y +CONFIG_XSI_SYSTEM_LOGGING=y diff --git a/tests/posix/common/src/syslog.c b/tests/posix/xsi_system_logging/src/main.c similarity index 84% rename from tests/posix/common/src/syslog.c rename to tests/posix/xsi_system_logging/src/main.c index 226853daf01..b3d023fb83f 100644 --- a/tests/posix/common/src/syslog.c +++ b/tests/posix/xsi_system_logging/src/main.c @@ -9,11 +9,11 @@ #include #include -#define N_PRIOS 8 +#define N_PRIOS 8 /* avoid clashing with Zephyr's LOG_ERR() */ #define _LOG_ERR 3 -ZTEST(syslog, test_syslog) +ZTEST(xsi_system_logging, test_syslog) { int prios[N_PRIOS] = { LOG_EMERG, LOG_ALERT, LOG_CRIT, _LOG_ERR, @@ -33,4 +33,4 @@ ZTEST(syslog, test_syslog) usleep(100000); } -ZTEST_SUITE(syslog, NULL, NULL, NULL, NULL, NULL); +ZTEST_SUITE(xsi_system_logging, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/posix/xsi_system_logging/testcase.yaml b/tests/posix/xsi_system_logging/testcase.yaml new file mode 100644 index 00000000000..352cfffce42 --- /dev/null +++ b/tests/posix/xsi_system_logging/testcase.yaml @@ -0,0 +1,24 @@ +common: + filter: not CONFIG_NATIVE_LIBC + tags: + - xsi.system.logging + # 1 tier0 platform per supported architecture + platform_key: + - arch + - simulation + min_flash: 64 + min_ram: 32 +tests: + portability.xsi.system.logging: {} + portability.xsi.system.logging.minimal: + extra_configs: + - CONFIG_MINIMAL_LIBC=y + portability.xsi.system.logging.newlib: + filter: TOOLCHAIN_HAS_NEWLIB == 1 + extra_configs: + - CONFIG_NEWLIB_LIBC=y + portability.xsi.system.logging.picolibc: + tags: picolibc + filter: CONFIG_PICOLIBC_SUPPORTED + extra_configs: + - CONFIG_PICOLIBC=y