Partially revert commit 0028e97332.
Timeout for tests/posix/common must be still increased for slow
platforms (previously was 120 sec).
Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
This commit disables the `tests/posix/common` test for the `qemu_leon3`
platform because of the alignment-related failure reported in the
GitHub issue zephyrproject-rtos/zephyr#48992.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Some platforms with insufficient ram were incorrectly included
in this test since #47288.
Fixes#47734
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
Add a simple test to ensure that we can create and join a
single thread `CONFIG_MAX_PTHREAD_COUNT` * 2 times. If
there are leaks, then `pthread_create()` should
eventually return `EAGAIN`. If there are no leaks, then
the test should pass.
Fixes#47609
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
Timeout must be increased for fvp_baser_aemv8r_aarch32 board. Enabling
MPU on this board makes simulation slower.
Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
This change adds coverage for picolibc in
* tests/posix/eventfd
* tests/posix/eventfd_basic
* tests/posix/getopt
Fixes#47288
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
Add test permutations that run against the newlib
libc against
* tests/posix/eventfd
* tests/posix/eventfd_basic
* tests/posix/getopt
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
* ensure test permutations are prefixed with `portability.posix`
* ensure test permutations include the `posix` tag
* ensure consistent order of `arch_exclude` and `tags`
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
Since `CONFIG_GETOPT=y` is specified in `prj.conf`,
it does not make sense to filter for `CONFIG_GETOPT`.
Additionally, we should run a permutation explicitly
with newlib, for consistency.
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
As Zephyr currently requires CMake version 3.20.0, update all
occurrences of cmake_minimum_required.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Now that picolibc's malloc arena configuration always allocates
some space, we don't need explicit allocations for tests.
Signed-off-by: Keith Packard <keithp@keithp.com>
* Convert test suite declaration to `ZTEST_SUITE()`
and test case declaration to `ZTEST()`.
* add `CONFIG_ZTEST_NEW_API=y` to prj.conf
Fixes#46793
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
As described in
https://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_once.html.
The behavior of pthread_once() is undefined if once_control has
automatic storage duration or is not initialized by PTHREAD_ONCE_INIT
However, in Zephyr, the implementation is incorrect. If the init value
is PTHREAD_ONCE_INIT, the program will never run the init_func.
Signed-off-by: Jaxson Han <jaxson.han@arm.com>
exclude newlib for posix testing as the MAX_HEAP_SIZE will be
too small if enabled NEWLIBC
fixing: #43873
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Various obsolote and misnamed platfomrs in test filters theat went
undetected for a while.
Fixes#41222
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Increase main stack size (in 128 bytes) to make these tests run
successfully on qemu_x86 platform.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Convert remaining tests and samples to using find_package() instead of
literally including the CMake boilerplate code.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The test assumed initial equality between CLOCK_MONOTONIC and
CLOCK_REALTIME and also assumed coarse granularity for each clock.
Neither of those assumptions are solid.
Furthermore, the test failed on multiple vendor boards which caused
some concern.
Remove the poorly conditioned tests and remove some comments
/ printks.
Fixes#35703
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The ehl_crb board has hardware issue that prevents this test from
being able to pass this otherwise-correct test. So exclude ehl_crb
from the testcase.yaml.
Fixes#33544.
Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
This k_usleep(1) is a tick alignment, not a workaround. Simple
reword to avoid confusion.
Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
Add error condition to test pthread. Like use pthread with
uninitialize stack or stack size is 0, and verify the result
is as expected.
Signed-off-by: Jian Kang <jianx.kang@intel.com>
tls rely on both arch has tls and toolchain support tls, add filter:
CONFIG_TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE for
some tests enabled tls.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
This commit adds the following tests:
* check eventfd with initval != 0
* check write counter overflow
* check if eventfd is blocked after read
* check if writing zero does not unblock
* check if nonblocking eventfd poll() behaviour is identical to blocking
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Here, we include some addtional tests for durations that have
sub-microsecond components.
1ns => k_busy_wait(0). Round to 1us.
1us + 1ns => k_busy_wait(1us). Round to 2us.
1s + 1ns => k_busy_wait(1000000us). Round to 1000001us.
1s + 1us + 1ns => k_busy_wait(1000001us). Round to 1000002us.
Fixes#28483
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Beyond the complexities of tick resolution on QEMU, this test is
invalid because POSIX nanosleep as currently implemented uses
k_busy_wait(ns / 1000) which means it's measuring the duration of
k_busy_wait(0) in ticks, which has no reasonable relation to 1 ns
regardless of tolerance.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Use the technique from portability/cmsis_rtos_v1 to compensate for
systems where times are being measured with different clocks.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
close in error handling attempts to close incorrect file descriptor.
Fixes#27327
Coverity-CID: 211585
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add new tests that will utilize open mode flags with the open
function.
A few test functions which assumed O_CREAT behavior are updated
to specify it explicitly.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
When there were multiple writes to eventfd, then poll() + read() should
start behaving as just initialized. Test that by verifying poll() will
timeout first and later be notified properly when eventfd is written
once again from the other thread.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>