Commit graph

395 commits

Author SHA1 Message Date
Krzysztof Chruscinski
4b1103547c tests: arch: arm: arm_interrupt: Increase stack size
Increase stack size for test thread. With no optimization
default stack size may not be enough.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-08-11 12:15:11 +02:00
Stephanos Ioannidis
5ceda9fe7d tests: arch: arm_hardfault_validation: Enable assert test mode
This commit enables the assert test mode (`CONFIG_ASSERT_TEST`) for the
ARM interrupt test because it relies on the assert function to return
without aborting in the "Assert occurring inside kernel panic" test.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-08-10 14:32:36 +02:00
Stephanos Ioannidis
b1fe54d9f0 tests: arch: arm_interrupt: Enable assert test mode
This commit enables the assert test mode (`CONFIG_ASSERT_TEST`) for the
ARM interrupt test because it relies on the assert function to return
without aborting in the in-ISR "Intentional assert" test.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-08-10 14:32:36 +02:00
Joakim Andersson
fcb9813128 tests: arm: Increase main stack size with no optimizations
If the test is run with the config NO_OPTIMIZATIONS enabled then the
stack size usage increases by around 80% for ARM platforms.
Increase the stack size used in test cases that enables building with no
optimizations for ARM.

Update description on TEST_ARM_CORTEX_M since it was outdated and said
it was only used for a single purpose.

Fixes: #47930
Fixes: #47929
Fixes: #47855

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-08-08 11:17:01 -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
Kumar Gala
b7fd26c141 tests: x86: Convert to test to use use DEVICE_DT_GET_ONE
Update test to use DEVICE_DT_GET_ONE to remove usage of
device_get_binding.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-22 17:19:13 -05:00
Johann Fischer
d66e047e5b tests: use unsigned int for irq_lock()
irq_lock() returns an unsigned integer key.
Generated by spatch using semantic patch
scripts/coccinelle/irq_lock.cocci

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-14 14:37:13 -05:00
Shaoan Li
d7541defbe tests: arch: arm: move test arm_irq_advanced_features to new ztest API
Migrate the testsuite tests/arch/arm/arm_irq_advanced_features to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-14 10:29:00 +02:00
Shaoan Li
e3d084ccb2 tests: arch: fix arm_thread_swap on stm32 platform
The test fails on several stm32 platforms, due to the
correlation between test_arm_syscalls and
test_arm_thread_swap, so disable the corresponding IRQ
interrupt may fix it.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-13 21:23:08 +02:00
Ederson de Souza
63a497280f test/arch: Remove xtensa_asm2 test
This test has been bitrotting for a while - years, in fact. As it didn't
have a `testcase.yaml`, it wasn't being run on twister. The code expects
to be run on single thread environment, but xtensa arch currently
doesn't support that.

This patch simply removes this test - if it's deemed important, it can
be reworked and readded in the future.

Fixes #47508.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-07-12 18:42:40 -04:00
Enjia Mai
06ab4d1912 tests: arch: x86: move the direct interrupt test to new ztest API
Migrate the testsuite tests/arch/direct_isr to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-12 13:21:47 -04:00
Enjia Mai
b3d442ec87 tests: kernel: move the direct interrupt test to arch testing
Move the direct interrupt test to tests/arch/x86/direct_isr. Two
reasons:
1. The direct interrupt is only for x86. It's arch-specific.
2. And it need extra gcc option to pass the build, that will
include testsuite number. Although it seems like we add a
extra testsuite for it, actually we can reduce whole tests
configuration in tests/kernel/interrupt. And also make this
test more generic as it used to be.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-12 13:21:47 -04:00
Alexandre Bourdiol
2d3c2efebd tests: arch: arm: arm-irq-vector-table: define _vector_end
Following implementation of commit 219d5b5,
and to complement commit 8c4f98d
it is also necessary define _vector_end in
test specific arm-irq-vector-table.ld

Fixes #47273

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-11 09:23:05 +00:00
Shaoan Li
f6322eb19f tests: arch: arm: move test arm_thread_swap_tz to new ztest API
Migrate the testsuite tests/arch/arm/arm_thread_swap_tz to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-08 10:53:27 +02:00
Shaoan Li
bfd59b17a1 tests: arch: arm: move test arm_thread_swap to new ztest API
Migrate the testsuite tests/arch/arm/arm_thread_swap to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-08 10:18:13 +02:00
Shaoan Li
432ae192df tests: arch: arm: move test arm_mem_protect to new ztest API
Migrate the testsuite tests/arch/arm/arm_mem_protect to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-08 10:17:58 +02:00
Kevin Townsend
9e4af9801a tests: arch: arm: Disable l552ze in arm.swap.tz
Disabling nucleo_l552ze_q_ns from the test suite since there isn't
enough room to sign the image with the toolchain used in CI. This can
be reverted if changes are made to the nucleo_l552ze_q_ns platform to
enable enough room for the signing data.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-07-07 15:11:38 +02:00
Shaoan Li
54d44ee0d6 tests: arch: arm: move test arm_hardfault_validation to new ztest API
Migrate the testsuite tests/arch/arm/arm_hardfault_validation to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 16:53:01 -05:00
Carlo Caione
b87a51b438 tests: arm64_high_addresses: Rework and move to new ztest API
Rework and migrate the test to the new ztest API.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-06 10:00:34 +00:00
Carlo Caione
8ada5b38c4 tests: arm64_gicv3_its: Move to new ztest API
Migrate the test to the new ztest API.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-06 10:00:34 +00:00
Carlo Caione
3a303498b4 tests: arm64_psci: Move to new ztest API
Migrate the test to the new ztest API.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-06 10:00:34 +00:00
Shaoan Li
8b346c984a tests: arch: arm: move test arm_tz_wrap_func to new ztest API
Migrate the testsuite tests/arch/arm/arm_tz_wrap_func to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 10:47:23 +02:00
Shaoan Li
52efe9eaa2 tests: arch: arm: move test arm_sw_vector_relay to new ztest API
Migrate the testsuite tests/arch/arm/arm_sw_vector_relay to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 10:47:17 +02:00
Shaoan Li
78a893ab0c tests: arch: arm: move test arm_runtime_nmi to new ztest API
Migrate the testsuite tests/arch/arm/arm_runtime_nmi to the new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 10:47:11 +02:00
Shaoan Li
b70a137396 tests: arch: arm: move test arm_ramfunc to new ztest API
Migrate the testsuite tests/arch/arm/arm_ramfunc to the new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 10:46:56 +02:00
Shaoan Li
80f62389ac tests: arch: arm: move test arm_irq_zero_latency_levels to new ztest API
Migrate the testsuite tests/arch/arm/arm_irq_zero_latency_levels to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 10:46:49 +02:00
Shaoan Li
7dc9d41bd3 tests: arch: arm: move test arm_interrupt to new ztest API
Migrate the testsuite tests/arch/arm/arm_interrupt to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 10:45:00 +02:00
Shaoan Li
813ee43c81 tests: arch: arm: move test arm_irq_vector_table to new ztest API
Migrate the testsuite tests/arch/arm/arm_irq_vector_table to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-05 12:18:08 +00:00
Keith Packard
9e698468ce tests/arm64: Run high_addr tests using picolibc
Picolibc enables TLS, which causes relocation errors with some of these
tests without changing the compiler code model.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-07-04 15:42:53 +00:00
Reto Schneider
7a6c5710ff cmake: Update cmake_minimum_required to 3.20.0
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>
2022-07-04 10:18:45 +02:00
Enjia Mai
e023a25a5a tests: arch: x86: move the test static_idt to new ztest API
Migrate the testsuite tests/arch/x86/static_idt to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-01 06:28:56 -04:00
Enjia Mai
6956364ec9 tests: arch: x86: move the test pagetables to new ztest API
Migrate the testsuite tests/arch/x86/pagetables to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-01 06:28:56 -04:00
Enjia Mai
1ba0721b18 tests: arch: x86: move the test NMI to new ztest API
Migrate the testsuite tests/arch/x86/nmi to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-01 06:28:56 -04:00
Enjia Mai
12ab020105 tests: arch: x86: move the test cpu_scrubs_regs to new ztest API
Migrate the testsuite tests/arch/x86/cpu_scrubs_regs to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-01 06:28:56 -04:00
Enjia Mai
7c304d6c2d tests: arch: common: move test semihost to new ztest API
Migrate the testsuite tests/arch/common/semihost to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-01 06:28:56 -04:00
Carlo Caione
c817b2661f test: arm_irq_vector_table: Fix when !CONFIG_GEN_IRQ_VECTOR_TABLE
This test is based on the wrong assumption that the IRQ vector table
symbols are always placed by the linker script also when
CONFIG_GEN_IRQ_VECTOR_TABLE is not actually set.

This is of course broken with the reworked mechanism of the IRQ vector
table placement.

Fix the test by reintroducing the old behaviour by forcefully
reinstating the symbols in the linker script.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-28 12:29:42 +02:00
Francois Ramu
06d222d16d tests: arm: runtime nmi testcase is flushing DCACHE
On mcu with Data Cache, when it is enabled (CONFIG_DCACHE=y),
the DCACHE must be flushed after the NMI loop to trig all
the irq, else the last one is missing.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-06-20 10:27:27 +02:00
Stephanos Ioannidis
19ba592f07 global: Correct extern K_THREAD_STACK_DEFINE usage
This commit corrects all `extern K_THREAD_STACK_DEFINE` macro usages
to use the `K_THREAD_STACK_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Øyvind Rønningstad
920028e03b tests: arm_thread_swap_tz: Explicitly set the TFM_PROFILE
to NOT_SET, in case the default is changed.

Add print of failing error code for psa_hash_compute().

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2022-06-05 14:48:31 +02:00
Hu Zhenyu
59357998d1 test: Remove the TC_XXX macro in tests/arch/arm/arm_runtime_nmi
As the test case is using ztest framework, so the TC_XXX macro
is never needed.

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-06-05 14:47:28 +02:00
Fabio Baltieri
e24314f10f include: add more missing zephyr/ prefixes
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Yuval Peress
86cadf9283 ztest: Fix userspace ztests in new API
Update the new API to use K_USER as the flags for both
CONFIG_USERSPACE and CONFIG_TEST_USERSPACE. Also, fix the linker
script to properly include the suites, tests, and rules.

Fixes #44108

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Anas Nashif
a6f924db7f twister: add support for platform_type filter
Instead of relying on runtime filter to limit scope to emulation
platforms, use the type attribute for each platform and do the filtering
very early on. This will speed things up for tests where we only run on
emulation platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00
Christoph Coenen
b3dfc244ad arch: arm: Add support for multiple zero-latency irq priorities
Add the ability to have multiple irq priority levels which are not
masked by irq_lock() by adding CONFIG_ZERO_LATENCY_LEVELS.

If CONFIG_ZERO_LATENCY_LEVELS is set to a value > 1 then multiple zero
latency irqs are reserved by the kernel (and not only one). The priority
of the zero-latency interrupt can be configured by IRQ_CONNECT.

To be backwards compatible the prio argument in IRQ_CONNECT is still
ignored and the target prio set to zero if CONFIG_ZERO_LATENCY_LEVELS
is 1 (default).

Implements #45276

Signed-off-by: Christoph Coenen <ccoenen@baumer.com>
2022-05-13 08:38:28 -05:00
TLIG Dhaou
4de1d01956 boards: stm32: use size helpers to describe size of storage partition
The goal of this commit is to update existing STM32 boards descriptions
to use these size "DT_SIZE" macros to enhance readability. To realize this
i used a python script, which will detect the STM32 Boards
/zephyr/board/arm, and then will update in the dts files the partition
description using "DT_SIZE_K" and "DT_SIZE_M" macros.
Check manually and modify in .overlay files in samples and tests.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-05-10 09:22:43 -05:00
Gerard Marull-Paretas
4b91c2d79f asm: update files with <zephyr/...> include prefix
Assembler files were not migrated with the new <zephyr/...> prefix.
Note that the conversion has been scripted, refer to #45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Gerard Marull-Paretas
ade7ccb918 tests: migrate includes to <zephyr/...>
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>
2022-05-06 20:02:14 +02:00
Daniel Leung
5a38451332 tests: x86/info: make it work with CONFIG_COUNTER_CMOS=n
There are boards without CMOS RTC, where blind accesses to
the RTC registers will freeze the system. So make the test
works with these boards if CONFIG_COUNTER_CMOS=n.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-05-04 09:42:26 -05:00
Jordan Yates
685e53231f tests: lib: semihost: test file operations
Add tests for basic file operations under semihosting.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-04-21 13:04:52 +02:00
Ryan McClelland
f7ddcd2713 arch: arm: aarch32: initialize FPSCR to reset value for ARMv8.1
With GCC 11 now supporting low overhead branching in ARMv8.1, ASM "LE"
(loop-end) instructions would trigger an INVSTATE hard-fault after
FPSCR was set to 0. This was due to the FPSCR getting a new field in
ARMv8.1. LTPSIZE is now set to it's reset value of Tail predication not
applied.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-04-15 10:33:48 -07:00