tests: posix: common: separate posix barriers to standalone test

posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves barrier into a singular
testsuite at tests/posix/barriers app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
This commit is contained in:
Marvin Ouma 2024-11-13 16:27:42 +03:00 committed by Anas Nashif
commit 05196e38a9
4 changed files with 41 additions and 2 deletions

View file

@ -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_barriers)
target_sources(app PRIVATE src/main.c)
target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)

View file

@ -0,0 +1,5 @@
CONFIG_POSIX_API=y
CONFIG_ZTEST=y
CONFIG_POSIX_AEP_CHOICE_BASE=y
CONFIG_POSIX_BARRIERS=y

View file

@ -10,7 +10,7 @@
#include <zephyr/sys/util.h>
#include <zephyr/ztest.h>
ZTEST(barrier, test_barrier)
ZTEST(posix_barriers, test_barrier)
{
int ret, pshared;
pthread_barrierattr_t attr;
@ -38,4 +38,4 @@ ZTEST(barrier, test_barrier)
zassert_equal(ret, 0, "pthread_barrierattr_destroy failed");
}
ZTEST_SUITE(barrier, NULL, NULL, NULL, NULL, NULL);
ZTEST_SUITE(posix_barriers, NULL, NULL, NULL, NULL, NULL);

View file

@ -0,0 +1,25 @@
common:
filter: not CONFIG_NATIVE_LIBC
tags:
- posix
- barriers
# 1 tier0 platform per supported architecture
platform_key:
- arch
- simulation
min_flash: 64
min_ram: 32
tests:
portability.posix.barriers: {}
portability.posix.barriers.minimal:
extra_configs:
- CONFIG_MINIMAL_LIBC=y
portability.posix.barriers.newlib:
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
portability.posix.barriers.picolibc:
tags: picolibc
filter: CONFIG_PICOLIBC_SUPPORTED
extra_configs:
- CONFIG_PICOLIBC=y