Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/posix/single_process/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(posix_single_process)

FILE(GLOB app_sources src/*.c)

target_sources(app PRIVATE ${app_sources})

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

ZTEST(confstr, test_confstr)
ZTEST(posix_single_process, test_confstr)
{
char buf[1];

Expand Down Expand Up @@ -63,5 +63,3 @@ ZTEST(confstr, test_confstr)
zassert_true(confstr(_CS_PATH, buf, sizeof(buf) > 0));
zassert_equal(buf[0], '\0');
}

ZTEST_SUITE(confstr, NULL, NULL, NULL, NULL, NULL);
10 changes: 10 additions & 0 deletions tests/posix/single_process/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2023, Meta
* Copyright (c) 2024, Marvin Ouma <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/ztest.h>

ZTEST_SUITE(posix_single_process, NULL, NULL, NULL, NULL, NULL);
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <zephyr/ztest.h>
#include <unistd.h>

ZTEST(posix_apis, test_posix_sysconf)
ZTEST(posix_single_process, test_posix_sysconf)
{
long ret;

Expand All @@ -23,10 +23,7 @@ ZTEST(posix_apis, test_posix_sysconf)
/* SC that value depends on target's configuration */
ret = sysconf(_SC_SEMAPHORES);
if (IS_ENABLED(CONFIG_POSIX_THREADS)) {
zassert_equal(ret,
_POSIX_VERSION,
"sysconf returned unexpected value %d",
ret);
zassert_equal(ret, _POSIX_VERSION, "sysconf returned unexpected value %d", ret);
} else {
zassert_equal(ret, -1L, "sysconf returned unexpected value %d", ret);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@

#include <zephyr/ztest.h>

ZTEST(uname, test_uname)
ZTEST(posix_single_process, test_uname)
{
struct utsname info;

zassert_ok(uname(&info));
zassert_ok(strncmp(info.sysname, "Zephyr", sizeof(info.sysname)));
zassert_ok(strncmp(info.machine, CONFIG_ARCH, sizeof(info.machine)));
}

ZTEST_SUITE(uname, NULL, NULL, NULL, NULL, NULL);
25 changes: 25 additions & 0 deletions tests/posix/single_process/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
common:
filter: not CONFIG_NATIVE_LIBC
tags:
- posix
- single_process
# 1 tier0 platform per supported architecture
platform_key:
- arch
- simulation
tests:
portability.single_process.rwlocks:
min_flash: 64
min_ram: 32
portability.posix.single_process.minimal:
extra_configs:
- CONFIG_MINIMAL_LIBC=y
portability.posix.single_process.newlib:
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
portability.posix.single_process.picolibc:
tags: picolibc
filter: CONFIG_PICOLIBC_SUPPORTED
extra_configs:
- CONFIG_PICOLIBC=y
Loading