Skip to content

Commit

Permalink
tests: posix: common: separate posix xsi system logging to standalone…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
  • Loading branch information
Pancakem authored and kartben committed Nov 26, 2024
1 parent 91e006c commit 9211abc
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
9 changes: 9 additions & 0 deletions tests/posix/xsi_system_logging/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(xsi_system_logging)

target_sources(app PRIVATE src/main.c)

target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)
5 changes: 5 additions & 0 deletions tests/posix/xsi_system_logging/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_XSI_SYSTEM_LOGGING=y
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include <zephyr/posix/unistd.h>
#include <zephyr/ztest.h>

#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,
Expand All @@ -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);
24 changes: 24 additions & 0 deletions tests/posix/xsi_system_logging/testcase.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9211abc

Please sign in to comment.