Commit graph zephyr/tests/kernel/context
Author SHA1 Message Date
Jamie McCrae
1538034c97 tests: kernel: Fix changing SoC specific Kconfig
Fixes wrongly setting a Kconfig for all devices for a Kconfig
that is SoC specific and moves it directly to the test

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-08-10 13:11:48 -07:00
Benjamin Cabé
a119dbf957 build: bump minimum CMake version to 3.28.0
Raise the minimum required CMake version from 3.20.0 (documented as
3.20.5) to 3.28.0, which is satisfied by the CMake 3.28.3 package
shipped in the Ubuntu 24.04 LTS repositories. Ubuntu 24.04 is the
current Ubuntu LTS release targeted by the Zephyr getting started
guide, and by the time of the next Zephyr release, Ubuntu 22.04 will be
within months of its end of standard support. Users of distributions
shipping an older CMake can use the Kitware APT repository or a
pip-installed CMake, as the documentation already suggests.

Raising the floor to 3.28 unlocks a range of modern CMake features for
the build system, among which the cmake_file_api() command (3.27),
file(COPY_FILE) (3.21), block()/endblock() (3.25), and allows removal
of several version-conditional workarounds.

The tree-wide cmake_minimum_required() occurrences in samples, tests
and boards are updated accordingly, together with the documentation
and the sysbuild CMake presets. The IAR C-STAT integration keeps its
own higher requirement (4.1.0).

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-03 15:03:35 -04:00
Etienne Carriere
c68c0a4685 tests: Include include/zephyr/sys/clock.h
Header file include/zephyr/sys_clock.h is deprecated and will be removed
someday. Update the whole file tree to include zephyr/sys/clock.h
straight instead of zephyr/sys_clock.h.

This change was made running the sed shell command below:
$ sed -i 's/zephyr\/sys_clock\.h/zephyr\/sys\/clock\.h/' \
      `grep -rsl "zephyr/sys_clock\.h" tests/`

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-07-30 07:45:05 -05:00
Peter Mitsis
13f173f629 tests: Allow a spurious wake in k_cpu_idle() test
Allows the test_cpu_idle_atomic to have one spurious timer interrupt
when using the Intel ADSP simulator. When using the simulator, the
timer is programmed to wake one tick early when the current cycle
count matches the 'last_count' -- a scenario that does not occur
on real hardware.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2026-07-07 17:40:55 -04:00
Anas Nashif
24f5bf4f35 tests: kernel: rename testcase.yaml to tests.yaml
Rename the test metadata file(s) in this area from testcase.yaml to
tests.yaml so sample and test metadata share one consistent filename
across the tree. Pure rename, no content change.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-03 19:23:13 -04:00
Anas Nashif
d158a74168 tests: kernel: context: refresh legacy README
Replace the outdated README.txt that still referenced "make run", the
"make clean/pristine" troubleshooting boilerplate and legacy tc_start()
output. Describe the current context, context_one_cpu and
context_cpu_idle Ztest suites and use twister/west build-and-run
instructions with current Ztest output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Assisted-by: Claude:opus-4.8
2026-07-01 17:06:27 -04:00
Anas Nashif
399f54b4e2 tests: kernel: context: add k_can_yield case and log conditional skips
Close two minor coverage gaps in the context suite:

- k_can_yield() was only checked incidentally inside other tests, so it
  had no named traceability entry. Add test_k_can_yield, asserting it is
  true in thread context and false in an irq_offload() ISR handler.

- The conditional skips in test_cpu_idle(_atomic), test_interrupts and
  test_timer_interrupts were silent. Print the reason before
  ztest_test_skip() so reports show why a platform skipped instead of
  reading as covered.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-30 11:54:27 -04:00
Anas Nashif
c62c622421 tests: kernel: context: cover nested irq_lock()/irq_unlock()
irq_lock() reentrancy was only exercised indirectly via the spinlock
tests; the context suite checked a single lock/unlock level only. Add
test_irq_lock_nested to verify the key property of nested locking: a
nested irq_lock() keeps interrupts masked, balancing the inner key must
NOT re-enable them while the outer lock is held, and only the unlock
balancing the outermost lock restores the original state.

arch_cpu_irqs_are_enabled() is used as the observable at each step,
extending the single-level coverage already provided by
test_arch_cpu_irqs_are_enabled. Verified on native_sim, qemu_x86,
qemu_cortex_m3 and qemu_riscv32.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Assisted-by: Claude:claude-opus-4-8
2026-06-30 11:54:27 -04:00
Anas Nashif
5dc3763261 tests: kernel: context: make test_thread actually verify coop context
test_thread was effectively a no-op. Its worker, kernel_thread_entry(),
blocked on k_sem_take(&sem_thread, K_FOREVER) before running any checks,
but the test never gave that semaphore. The worker only reached
_test_kernel_thread() because test_k_yield(), which runs earlier in the
same suite, happened to leak a semaphore count of one - a fragile
ordering dependency that silently dropped all coverage when the test ran
in isolation. The body itself contained no assertions and did not join
the worker, so a worker that blocked forever still passed. The parent
thread id was also passed as NULL, making the worker's "id differs from
spawner" check trivially true.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-30 11:54:27 -04:00
Anas Nashif
7fa939db75 tests: kernel: context: document tests and align group naming
Bring the context test documentation in line with the test
documentation conventions: rename the Doxygen module from
kernel_context_tests to the tests_-prefixed tests_kernel_context so it
groups under all_tests consistently, and rewrite the remaining cases
that still used the older "Test Objective / Testing techniques /
Pass/Fail criteria" format into the concise @details / Test steps /
Expected result template already used by the rest of the file.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-30 11:54:27 -04:00
Anas Nashif
2a70d46ef7 tests: kernel: context: document tests and fix doxygen group
Convert the file-level group comment from a plain /* block to a /**
Doxygen comment so the kernel_context_tests group is actually picked up,
and rewrite the individual test descriptions to consistently document
what each case verifies.

Assisted-by: Claude:claude-opus-4.8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-26 07:46:23 -04:00
Nicolas Pitre
1296dc85e3 kernel: timer: make k_timer_start duration match documented semantics
The documentation for timer objects in
doc/kernel/services/timing/timers.rst has always stated:

    The timer's duration is a **minimum** delay relative to the time
    the timer was started.

However the implementation did not actually honour that contract. When
starting a relative duration, k_timer_start() was subtracting one from
duration.ticks before passing it to z_add_timeout(), cancelling out
z_add_timeout()'s conservative round-up. The net result was that
k_timer_start(K_TICKS(N), ...) could fire anywhere from just after 0
up to N ticks later -- strictly less than the documented minimum.

The in-tree comment acknowledged the mismatch ("i.e. k_timer_start()
doesn't treat its initial sleep argument the same way k_sleep() does,
but historical") and kept the subtraction for backwards compatibility.

This has lasted long enough. Drop the subtraction (and the companion
max(1, ...) whose only purpose was to keep the subtraction from
underflowing). k_timer_start() now honours its documented "minimum
delay" contract, matching the behaviour of k_sleep() for the same
tick count.

Callers that relied on the old "approximately N ticks" timing will
see up to one extra tick of delay on the initial fire, when the
call happens partway through a tick. Subsequent periodic fires are
unaffected: they are rescheduled from the timer ISR at an exact
tick boundary and continue to honour the period as before.

Note that a timer manually re-armed from within its own expiry
callback (rather than via the periodic 'period' argument) does not
suffer from the extra tick either: the callback runs inside
sys_clock_announce_locked(), so z_add_timeout()'s round-up is skipped
and the new fire lands at an exact tick stride. This preserves the
behaviour that the original -1 on the duration was presumably trying
to achieve in the first place, now obtained via the proper mechanism.

A few in-tree tests were tuned too tightly against the old
"approximately N" timing. Widen their tolerances to match the new
"at least N" contract:

  - tests/kernel/timer/timer_api: add one tick of slack in
    interval_check() to absorb the round-up.
  - tests/kernel/context: widen idle-timer slop by one tick.
  - tests/kernel/workq/work: express the busy-wait margin in ticks
    in the "running cancel" tests.
  - tests/kernel/threads/no-multithreading: on tickful kernels the
    pending IRQ delivered after irq_unlock()/k_cpu_idle() only
    announces one tick; wait one extra tick or loop idling until
    the timer callback runs.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-05-04 21:55:33 +02:00
Nicolas Pitre
de007168e2 tests: kernel: context: harden test_cpu_idle against background timers
test_cpu_idle asserts that while k_cpu_idle() is suspended, the only
interrupt that wakes the CPU is the one from the user's scheduled
timer. Several in-tree subsystems and drivers schedule their own
periodic timeouts independently of the test and can spuriously wake
the idle:

  - CONFIG_TIMESLICING arms a per-CPU slice timeout on every thread
    swap. That timeout fires regardless of the test's idle timer.
  - CONFIG_EVICTION_NRU (demand paging) runs a periodic pulse every
    CONFIG_EVICTION_NRU_PERIOD to clear accessed bits, also firing
    behind the test's back.
  - The Renesas RX CMT timer driver uses a 16-bit counter that
    cannot span more than one tick period, so it has to schedule
    multi-tick timeouts in multiple stages and delivers an
    intermediate tick announcement before the requested deadline.

All three have been able to break the test for a long time when
enabled; they just happened not to be exercised under the old
k_timer_start() timing. Disable TIMESLICING in prj.conf, filter out
configurations where EVICTION_NRU is selected, and bump MAX_IDLE_WAKES
to 1 for RENESAS_RX_TIMER_CMT, which is what actually makes the test
invariant hold.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-05-04 21:55:33 +02:00
Nicolas Pitre
e81266be2b arch: add arch_cpu_irqs_are_enabled() primitive
Introduce an architecture API that reports the calling CPU's current
interrupt-enable state without modifying it. Unlike arch_irq_unlocked()
which inspects a saved key, this one probes the live CPU register, which
lets callers avoid the lock/unlock dance when all they need is to test
whether IRQs are currently masked.

Most arches can serve this from a single register read (DAIF on arm64,
PRIMASK/BASEPRI/CPSR on arm, mstatus on riscv, PS on xtensa, STATUS32
on arc, c0_status on mips, SPR_SR on openrisc, PSW on rx, EFLAGS on
x86). SPARC, POSIX, and riscv with custom SoC IRQ-lock ops have no
direct probe and fall back to a brief arch_irq_lock()/unlock() pair.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-05-01 11:18:04 -05:00
Daniel Leung
d296db76c5 tests: kernel/context: skip idle test for whisper
The whisper simulator does not have a working implementation
for wfi instruction and simply treats it as no-op. Therefore,
any CPU idle test will fail as wfi returns immediately. So
skip those tests.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-03-23 08:56:34 -04:00
Joel Holdsworth
a737213c98 tests: Add basic test-set for OpenRISC architecture port
The OpenRISC 1000 architecture can be tested through the qemu_or1k emulated
SoC and board. Because this emulated device has minimal external hardware
by default, this patch enables a minimal suite of tests covering core
kernel features for the CPU architecture.

When running the test suite, OpenRISC was found to require additional stack
space to prevent an overflow. Therefore, a minimal additional amount of
storage: 128-bytes, was added that was found in practice to allow tests to
complete.

Note that Qemu version 9.2.0 or newer is required so as to include the
following commit:

    commit 3eb43aeb164f1f83c97ff693c7d464b49755110c
    Author: Joel Holdsworth <jholdsworth@nvidia.com>
    Date:   Fri Jun 7 15:29:33 2024 -0700

        hw/openrisc: Fixed undercounting of TTCR in continuous mode

This fixes a bug in the implementation of the emulated OpenRISC Tick Timer
which prevents the Zephyr OpenRISC port from task-scheduling properly.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2026-03-21 07:50:57 -05:00
Jerzy Kasenberg
3591f5cc82 tests: kernel: context: Disable PM for Smartbond
kernel context test check timing and extra interrupts
being thrown during sleep tests.

Power management is disabled because during tests
code tests sleep and with power management enabled
it could result in going to deep sleep that takes
more time than is allowed.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg.xr@bp.renesas.com>
2025-11-20 06:01:14 -05:00
Pete Johanson
112871afa4 tests/kernel/context: Properly idle on MAX32 family
Make sure MAX32_ON_ENTER_CPU_IDLE_HOOK is disabled for the context test, so
the CPU will actually idle with WFI and not return before the timer
expires for test_cpu_idle test.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2025-11-07 16:12:48 -05:00
Anas Nashif
9198b9d1ba tests: increase stack sizes to support coverage
Increase stack sizes to allow coverage to complete.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-14 17:32:46 -04:00
Krzysztof Chruściński
5acd29e651 tests: all: Fix remaining issues reported by string validation
Fix issues reported by string validation which was added to strings
used in zassert macros.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-05-27 09:16:08 +02:00
Anas Nashif
e48c90700d doc: remove more occurances of Nios II
Remove all occurances of Nios II from docs and code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-15 20:01:05 -04:00
Anas Nashif
5fe84d5b69 arch: nios2: remove arch
Remove architecture and dependencies.
Remove altera HAL supporting nios2

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-15 20:01:05 -04:00
Alberto Escolar Piedras
56fdebe933 tests/kernel/context: Remove BOARD_NATIVE_POSIX check
native_posix has been removed. There is no need to check for it
anymore.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-12 02:27:36 +01:00
Nicolas Pitre
46aa6717ff Revert "arch: deprecate _current"
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").

This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.

The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.

Hence this revert.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-10 07:49:08 +01:00
Valerio Setti
522b1f2bba Revert "tests: disable NRF5 entropy driver on some bsim/qemu tests"
This reverts commit e0fcb8552428fb45164ea2b4271b3b0206695b7f.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-12 00:15:39 +00:00
Valerio Setti
22e30e04f5 tests: disable NRF5 entropy driver on some bsim/qemu tests
CONFIG_ENTROPY_GENERATOR is now enabled by default as soon as
"zephyr,entropy" is set in the device-tree. Since the sub-Kconfig
CONFIG_ENTROPY_NRF5_RNG is also enabled by default on nrf boards,
this means that the driver is pulled in the build and intialized
at boot. This might cause runtime issues during some IRQ/kernel
tests, so it's better to remove "zephyr,entropy" on these tests.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Gerard Marull-Paretas
d4a67e321b samples, tests: remove usage of space-separated lists
Convert them to native YAML lists. Support for space-separated
lists was deprecated in Twister a long time ago.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-04 14:14:53 -05:00
Yong Cong Sin
b1def7145f arch: deprecate _current
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Dong Wang
f61b8f9fd2 tests/kernel/context: correct the way to get IRQ number of APIC TSC Timer
This case fails to build on boards having APIC TSC timer enabled.
This change is needed after moving APIC TSC timer support from
apic_timer.c to apic_tsc.c.

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2024-09-23 14:10:27 +01:00
Alberto Escolar Piedras
53a47a2e1a tests/kernel/context: Correct dependency
An ifdef should have been also checking for native_sim,
let's correct it.

Note: By now native_sim builds with "native_posix compatibility mode"
enabled, which sets BOARD_NATIVE_POSIX to avoid breaking all this kind
of dependencies. But that will stop soon.
So let's fix the dependencies.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-16 11:20:34 +01:00
Alberto Escolar Piedras
22c83f0f97 tests/kernel/context: Detect spurious wakes during timeout check
In 972a4d9f6f
the test was relaxed to allow a possible parallel thread
waking the CPU during the idle timeout checks.

How this was done though, a system timer driver
which wakes the kernel spuriously a bit before the
correct deadline would not be detected, even
though it should.

Let's fix this, ensuring the timer has been
called when we check the wake time in inside the
expected range.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-07 17:56:50 -04:00
Alberto Escolar Piedras
972a4d9f6f tests/kernel/context: Improve to resist parallel threads interrupting
This test assumes that nothing will wake the CPU apart from
the timer set by the test.
But that is not necessarily the case.
Some other platform thread started at boot
may be waking the CPU every now and then.

Let's allow for some spurious wakes while we are testing k_cpu_idle,
while at the same time ensuring we are not just busy waiting
all the way.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-15 09:58:26 +01:00
Gerard Marull-Paretas
f885763b50 arch: riscv: drop RISCV_HAS_CPU_IDLE
Because it was exclusively used by the "common" RISC-V privileged code
to build CPU idle routines that are now handled by arch level code.
Also, all platforms defaulted to "y", making it pointless in practice.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-12 09:58:31 +01:00
Alberto Escolar Piedras
30c660162f tests/kernel/context: Fix for nrf5340bsim_nrf5340_cpunet
This test assumes nothing else is running in the background
but when the logger is on, this board will by default
start the RTC sync mechanism, which will awake the CPU
every now and then.
Let's disable this mechanism to avoid disturbing the test.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-11 11:44:09 -05:00
Anas Nashif
345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Keith Packard
844c78cf3a tests/kernel: Also run tests using minimallibc
With picolibc being the default C library, we need to explicitly include
testing against the minimal C library for kernel components.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-04 15:29:13 -04:00
Evgeniy Paltsev
a260d5b6bb ARC: tests: re-enable cpu_idle test for SMP nSIM platforms
The original issue is fixed some time ago, so re-enable the
test.

This reverts commit 52992b0658
("tests: skip the cpu_idle test for nsim_hs_smp")

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-08-11 12:01:01 +00:00
Anas Nashif
3a24476fb7 tests: kernel: fix some test identifiers
Fixed few test identifiers and tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-07-19 18:07:49 -04:00
Anas Nashif
b835b02136 tests: cleanup metadata and filtering
- Add integration_platforms to avoid excessive filtering
- Make sure integration platforms are actually part of the filter
- Fix some tags and test meta data

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-13 09:38:27 -04:00
Peter Mitsis
d26d3f9fd4 test: Change loop calibration count initialization
The kernel/context test_timer_interrupts() test has a loop calibration
phase to estimate the number of loops needed for 1 system tick.
By initializing this calibration to 1 instead of 0, we can avoid an
edge condition where the calibration phase indicates 0 loops are
required (a case that could happen when running on a slow simulator).

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-06-02 17:43:59 -04:00
Gerard Marull-Paretas
93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Keith Packard
95a5c60abf tests/kernel: Cast time difference to int32_t before abs call
Clang complains when an unsigned value is passed to abs, even though there
is an implicit cast to a signed type. Insert an explicit cast to make clang
happy.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-05 10:38:34 +02:00
Alberto Escolar Piedras
a2541d6c82 util: Replace all POSIX arch busy_waits with Z_SPIN_DELAY
A new Z_SPIN_DELAY() macro has been added which
can be used to reduce a bit the amount of noise
due to the POSIX arch need to break busy loops with
k_busy_wait().
Use it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-03-04 22:14:04 +01:00
Keith Packard
e490fe0f67 tests: kernel: Provide more stack space for context test
This test overflows when TLS is used, provide plenty of extra space to
avoid that.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-01-26 10:04:33 +00:00
Jan Malek
6fb644c663 renode: Add Renode overlays for selected tests
Tune quantum parameter for selected kernel tests
targetting the HiFive Unleashed platform.

Those tests require higher fidelity of the virtual
time flow which is achievable on multi-core platforms
in Renode by reducing the quantum.

Signed-off-by: Jan Malek <jmalek@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2023-01-25 14:02:29 -08:00
Kumar Gala
4f0166088c tests: move to using CONFIG_MP_MAX_NUM_CPUS
For tests that set CONFIG_MP_NUM_CPUS, switch to using
CONFIG_MP_MAX_NUM_CPUS instead as we work to phase out
CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-20 22:04:10 +09:00
Evgeniy Paltsev
a76103ce59 tests/kernel/context: don't do print in time-critical section
In test_busy_wait and test_k_sleep test cases of
tests/kernel/context test we measure not only execution time of the
primitives itself (k_busy_wait and k_msleep respectively) but also
the overall test thread execution time.

The issue here is that we do printing in test threads which
means that we do printing in time-critical sections. That breaks
test if we do printing via some device which isn't fast enough.

Fix that by removing print from time-critical section

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2022-10-11 11:11:45 +02:00
Guo Lixin
0356e1a925 tests: kernel: context: move to new ztest API
Move tests/kernel/context/ to use new ztest API.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-08-04 13:42:47 +02:00
Gerard Marull-Paretas
44250fe3d3 soc: arch: synopsys: move timer0/1 IRQ information to DT
timer0/1 IRQ information was hardcoded in soc.h, however, Devicetree is
nowadays a better place to describe hardware. Note that I have followed
existing upstream Linux code to do these changes.

Ref.
- https://elixir.bootlin.com/linux/latest/source/arch/arc/boot/dts/
  hsdk.dts
- https://elixir.bootlin.com/linux/latest/source/Documentation/
  devicetree/bindings/timer/snps,arc-timer.txt

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 07:46:14 -04:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
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>
2022-08-02 16:41:41 +01:00