tests: posix: common: separate posix spinlock tests into standalone test
posix.common contains testsuites that can be separated into smaller groups of tests. This change moves spinlock into a singular testsuite at tests/posix/spinlocks app directory. Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
This commit is contained in:
parent
6d38b24d32
commit
69e8152fc1
4 changed files with 46 additions and 4 deletions
9
tests/posix/spinlocks/CMakeLists.txt
Normal file
9
tests/posix/spinlocks/CMakeLists.txt
Normal 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_spinlocks)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
|
||||
target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)
|
5
tests/posix/spinlocks/prj.conf
Normal file
5
tests/posix/spinlocks/prj.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
CONFIG_POSIX_API=y
|
||||
CONFIG_ZTEST=y
|
||||
|
||||
CONFIG_POSIX_AEP_CHOICE_BASE=y
|
||||
CONFIG_POSIX_SPIN_LOCKS=y
|
|
@ -9,7 +9,7 @@
|
|||
#include <zephyr/ztest.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
|
||||
ZTEST(spinlock, test_spin_init_destroy)
|
||||
ZTEST(posix_spinlocks, test_spin_init_destroy)
|
||||
{
|
||||
pthread_spinlock_t lock;
|
||||
|
||||
|
@ -24,7 +24,7 @@ ZTEST(spinlock, test_spin_init_destroy)
|
|||
zassert_ok(pthread_spin_destroy(&lock), "pthread_spin_destroy() failed");
|
||||
}
|
||||
|
||||
ZTEST(spinlock, test_spin_descriptor_leak)
|
||||
ZTEST(posix_spinlocks, test_spin_descriptor_leak)
|
||||
{
|
||||
pthread_spinlock_t lock[CONFIG_MAX_PTHREAD_SPINLOCK_COUNT];
|
||||
|
||||
|
@ -47,7 +47,7 @@ ZTEST(spinlock, test_spin_descriptor_leak)
|
|||
}
|
||||
}
|
||||
|
||||
ZTEST(spinlock, test_spin_lock_unlock)
|
||||
ZTEST(posix_spinlocks, test_spin_lock_unlock)
|
||||
{
|
||||
pthread_spinlock_t lock;
|
||||
|
||||
|
@ -70,4 +70,4 @@ ZTEST(spinlock, test_spin_lock_unlock)
|
|||
zassert_equal(pthread_spin_destroy(&lock), EINVAL, "pthread_spin_unlock() did not fail");
|
||||
}
|
||||
|
||||
ZTEST_SUITE(spinlock, NULL, NULL, NULL, NULL, NULL);
|
||||
ZTEST_SUITE(posix_spinlocks, NULL, NULL, NULL, NULL, NULL);
|
28
tests/posix/spinlocks/testcase.yaml
Normal file
28
tests/posix/spinlocks/testcase.yaml
Normal file
|
@ -0,0 +1,28 @@
|
|||
common:
|
||||
filter: not CONFIG_NATIVE_LIBC
|
||||
tags:
|
||||
- posix
|
||||
- spinlocks
|
||||
# 1 tier0 platform per supported architecture
|
||||
platform_key:
|
||||
- arch
|
||||
- simulation
|
||||
min_flash: 64
|
||||
min_ram: 32
|
||||
tests:
|
||||
portability.posix.spinlocks: {}
|
||||
portability.posix.spinlocks.minimal:
|
||||
extra_configs:
|
||||
- CONFIG_MINIMAL_LIBC=y
|
||||
portability.posix.spinlocks.newlib:
|
||||
filter: TOOLCHAIN_HAS_NEWLIB == 1
|
||||
extra_configs:
|
||||
- CONFIG_NEWLIB_LIBC=y
|
||||
portability.posix.spinlocks.picolibc:
|
||||
tags: picolibc
|
||||
filter: CONFIG_PICOLIBC_SUPPORTED
|
||||
extra_configs:
|
||||
- CONFIG_PICOLIBC=y
|
||||
portability.posix.spinlocks.no_spin_validate:
|
||||
extra_configs:
|
||||
- CONFIG_SPIN_VALIDATE=n
|
Loading…
Add table
Add a link
Reference in a new issue