Commit Graph

21 Commits

Author SHA1 Message Date
Alberto Escolar Piedras
35ba7dbdf7 tests/lib/c_lib/thrd: Remove filter on NATIVE_APPLICATION
It is not possible to build anymore in that mode, so this filter
is not needed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:15 +02:00
Chris Friedt
9ecb7965b6 tests: libc: thrd: use sys_clock_gettime() and timespec_add()
Use sys_clock_gettime() instead of clock_gettime() and use
timespec_add() instead of manually adding timespec structures.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Chris Friedt
ec62630950 tests: libc: thrd: use timespec_from_timeout()
Use `timespec_from_timeout(K_MSEC(msec), &ts)` instead of leaning on
lazily-crafted timespecs with invalid tv_nsec fields.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Chris Friedt
a17497162e tests: libc: thrd: do not pass NULL for thrd_sleep() duration
The specification does not say that the first struct timespec passed to
thrd_sleep() may be NULL.

Preserving the testpoint so that a possible future testsuite can be
run that expects faults to occur when undefined behaviour is used.

Faults are one possible solution to handling undefined behaviour, but
it would be good to come to a concensus about how that should be
handled in Zephyr for standard function calls belonging to ISO C or
POSIX.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Chris Friedt
a5a824db91 tests: libc: thrd: compare with thrd_success rather than ok or zero
The C standard does not guarantee that `thrd_success` is equal to
zero, so ensure that the test takes that into account.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Anas Nashif
e5edf45596 tests: c_lib: thrd: run test on 1 cpu
This test fails sporadically on SMP, so make it run only on one CPU.

Related to zephyrproject-rtos/zephyr#91620

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-14 12:36:48 -04:00
Chris Friedt
a10f96e153 posix + tests: use CLOCK_REALTIME where specified by POSIX
Use CLOCK_REALTIME for the default clock source throughout
the POSIX implementation and tests so that we are
consistent with the specification.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-24 22:58:43 +02:00
Daniel Leung
06e6a84b1d tests: copy intel_adsp_ace30_ptl.conf to *_sim.conf
With the rename of intel_adsp/ace30_ptl to intel_adsp/ace30/ptl,
the "sim" variant no longer inherit the base configuration. So
make a copy of the .conf file to explicitly target the sim
variant.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-18 13:18:22 -05:00
Daniel Leung
3d65839dbc tests: rename intel_adsp_ace30.conf to intel_adsp_ace30_ptl.conf
The board has been renamed from intel_adsp/ace30_ptl to
intel_adsp/ace30/ptl. So the corresponding board only configs
for tests also need to renamed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-10-03 22:00:54 +01:00
Grzegorz Bernat
a654bfbdfa soc: intel: renamed soc from ace30_ptl to ace30
Renamed soc from ace30_ptl to ace30.
We were previously using the wrong soc name.
The correct name is ace30.

There is only one ptl platform, but there can be several ace30 platforms.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-09-24 10:10:37 +02:00
Chris Friedt
2aa31a3695 tests: posix: one tier0 platform per arch for integration tests
Add one tier0 platform per supported architecture.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-08-08 20:23:36 -04:00
Daniel Leung
8c65c73cf8 tests: lib/c_lib/thrd: config overlay for intel_adsp/ace30_ptl
This sets CONFIG_MAX_THREAD_BYTES to 3 as the tests need a few
more bits to build for board intel_adsp/ace30_ptl.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-06 20:06:11 -04:00
Alberto Escolar Piedras
2c6db3b717 tests/lib: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Daniel Leung
78fe66834f tests: c_lib/thrd: more stack for up_squared board
Similar to qemu_x86_64, the up_squared needs more stack space
to run the tests.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-02-14 19:08:02 +01:00
Christopher Friedt
dbf7003162 tests: posix + libc: qemu_x86*: use dynamic stack size of 4096
For qemu_x86 and qemu_x86_64, it would seem that
heap-allocated thread stacks, as well as thread stacks
defined via K_THREAD_STACK_ARRAY_DEFINE(), must be at least
4096 bytes in size.

Using those sizes will ensure that these tests do not
fail with stack overflows or MMU faults.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Peter Mitsis
77abd6f89d tests: Allow thrd test to run on xtensa
On some SMP platforms (such as intel_adsp_ace15_mtpm) it is not
safe to access the stack of a thread that is currently executing
on another CPU. This requires that tests be written such that
objects and data that are shared between threads that may execute
concurrently on different CPUs be placed into memory that is not
a thread's stack.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-11-28 14:46:15 -05:00
Christopher Friedt
2fc19aa033 tests: lib: c_lib: tests for C11 call_once()
Add tests for C11 call_once().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
44a431bbba tests: lib: c_lib: tests for C11 thread-specific storage
Add tests for C11 thread-specific storage.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
70b03111eb tests: lib: c_lib: tests for C11 condition variables
Add tests for C11 condition variables.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
0c2da383d3 tests: lib: c_lib: add tests for C11 mutexes
Add tests to cover C11 mutexes

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
ded97fd5b3 tests: libc: add tests for iso c11 threads
Add tests to verify functionality of the C11 `<threads.h>` API.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00