Skip to content

Commit 05196e3

Browse files
Pancakemnashif
authored andcommitted
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 <[email protected]>
1 parent a199f7f commit 05196e3

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

tests/posix/barriers/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(posix_barriers)
6+
7+
target_sources(app PRIVATE src/main.c)
8+
9+
target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)

tests/posix/barriers/prj.conf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_POSIX_API=y
2+
CONFIG_ZTEST=y
3+
4+
CONFIG_POSIX_AEP_CHOICE_BASE=y
5+
CONFIG_POSIX_BARRIERS=y

tests/posix/common/src/barrier.c renamed to tests/posix/barriers/src/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <zephyr/sys/util.h>
1111
#include <zephyr/ztest.h>
1212

13-
ZTEST(barrier, test_barrier)
13+
ZTEST(posix_barriers, test_barrier)
1414
{
1515
int ret, pshared;
1616
pthread_barrierattr_t attr;
@@ -38,4 +38,4 @@ ZTEST(barrier, test_barrier)
3838
zassert_equal(ret, 0, "pthread_barrierattr_destroy failed");
3939
}
4040

41-
ZTEST_SUITE(barrier, NULL, NULL, NULL, NULL, NULL);
41+
ZTEST_SUITE(posix_barriers, NULL, NULL, NULL, NULL, NULL);

tests/posix/barriers/testcase.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
common:
2+
filter: not CONFIG_NATIVE_LIBC
3+
tags:
4+
- posix
5+
- barriers
6+
# 1 tier0 platform per supported architecture
7+
platform_key:
8+
- arch
9+
- simulation
10+
min_flash: 64
11+
min_ram: 32
12+
tests:
13+
portability.posix.barriers: {}
14+
portability.posix.barriers.minimal:
15+
extra_configs:
16+
- CONFIG_MINIMAL_LIBC=y
17+
portability.posix.barriers.newlib:
18+
filter: TOOLCHAIN_HAS_NEWLIB == 1
19+
extra_configs:
20+
- CONFIG_NEWLIB_LIBC=y
21+
portability.posix.barriers.picolibc:
22+
tags: picolibc
23+
filter: CONFIG_PICOLIBC_SUPPORTED
24+
extra_configs:
25+
- CONFIG_PICOLIBC=y

0 commit comments

Comments
 (0)