Skip to content

Commit

Permalink
tests: posix: common: separate posix barriers 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 barrier into a singular
testsuite at tests/posix/barriers app directory.

Signed-off-by: Marvin Ouma <[email protected]>
  • Loading branch information
Pancakem committed Nov 14, 2024
1 parent 049b243 commit 09ae5d5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
9 changes: 9 additions & 0 deletions tests/posix/barriers/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_barriers)

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/barriers/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_BARRIERS=y
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
25 changes: 25 additions & 0 deletions tests/posix/barriers/testcase.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 09ae5d5

Please sign in to comment.