Commit graph

6,360 commits

Author SHA1 Message Date
Guðni Már Gilbert
b7efede67e scripts: kconfig: optimize write_kconfig_filenames
Filter duplicate entries in `kconf.kconfig_filenames` before calling
`os.path.realpath`.

Before (current code), all entries in `kconf.kconfig_filenames` go
through `os.path.realpath`. Including all duplicate entries.

With the proposed change, the duplicate entries are removed before
calling `os.path.realpath`.

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2025-08-13 18:31:41 +02:00
Lukasz Fundakowski
fc8164036c twister: Fix pytest warnings while discovers tests
Added `__test__ = False` to classes that have
`Test` in the name.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2025-08-12 20:39:29 -04:00
Fabio Baltieri
ee5b5f30fe twister: always call flash directly
Drop the logic to use the generator "flash" target, that is using west
anyway, always call flash directly anyway so that those targets can be
deprecated.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-08-12 09:55:47 +03:00
Hake Huang
9e551f5877 twister: harness: add display harness
display harness to validate display content

Signed-off-by: Hake Huang <hake.huang@nxp.com>
Co-authored-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-08-12 09:54:27 +03:00
Hau Ho
6b1f06b202 scripts: west: flash: Add support for scripts to flash using the RFP tool.
Add support for scripts to flash using the RFP tool.

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2025-08-11 12:48:35 +03:00
Sylvio Alves
3d0192df75 runner: esp32: remove unused entries
Both partition_table and bootloader entries are not necessary for esp32
runner.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-08-07 13:14:40 +02:00
Henrik Brix Andersen
f567c22f37 scripts: west: commands: completion: bash: add --domain completion
Add completion support for "west build --domain" under the Bash shell.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2025-08-06 12:04:10 -04:00
Johann Fischer
1c0a4ca645 scripts: ci: check_compliance.py: add BOOT_SERIAL_UART to ALLOWLIST
Add Kconfig option BOOT_SERIAL_UART, defined in the MCUboot module but
needed to be used in tests, to the UNDEF_KCONFIG_ALLOWLIST.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-08-06 11:57:39 -04:00
Daniel DeGrasse
2d2e64af17 scripts: ci: exempt BOOT_RAM_LOAD_REVERT from checks
Add BOOT_RAM_LOAD_REVERT as a defined Kconfig to the whitelist

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-08-05 11:53:58 +01:00
Marek Matej
fa1840268b scripts: update the CI requirements for Espressif port
Updated twister.yaml workflow to fetch esptool for the CI.
Fix format of the arguments used in the esptool-5.0.2.
Check that esptool is available on build time.
Update runners for esp32.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-08-04 17:02:52 -04:00
Lauren Murphy
69a3ed2753 llext: replace stripping script with call to zephyr sdk strip
Replace custom stripping script with a call to Zephyr SDK strip.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Lauren Murphy
92db7bcf11 llext: compile llext with arc mwdt on nsim vpx5
Allow users to compile LLEXTs with the MetaWare Design Toolchain.
Provides utility to dramatically shrink bloated extensions by removing
unused section names left behind by MWDT strip. Test extensions will
not fit in NSIM VPX5 memory otherwise; each is reduced from ~16k to ~1k.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Anas Nashif
b1a3dc00b0 twister: report: switch --detailed-test-id logic
now no-detailed-test-id is enabled by default, so switch the logic so we
do not require the extra parameter when reruning.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 07:50:10 -04:00
Anas Nashif
7b1cc710b1 ci: test_plan: do not filter same test with different toolchain
Make sure we get same test with different tests included.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 07:50:10 -04:00
Anas Nashif
45596b7d71 ci: test_plan: fix detailed test id handling
detailed test id is no longer default, so switch the logic to deal with
that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 07:50:10 -04:00
Declan Snyder
b45bc0332d scripts: check_init_priorities: Fix file leak
The elf file needs to be closed after done being used, otherwise sys
module will generate resource leak warnings.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-30 06:13:21 -04:00
Declan Snyder
0d6b0cebb1 scripts: gen_offset_header: Fix file leak
The files should be closed after done being used, otherwise python
warnings are generated from the sys module

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-30 06:13:21 -04:00
Luca Burelli
83b9577f38 west build: display closest matching board names on error
This commit modifies the 'west build' command to display the closest
matching boards when an invalid board is specified, making it easier
for users to find a typo in the used board name.

The user is also instructed to run 'west boards' if he wants to get
the full list of available boards.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-07-30 06:11:09 -04:00
Robert Robinson
8e69b52205 scripts: twister: handlers: Append dev-id for runner nrfutil_next
appends the --dev-id argument when using nrfutil_next runner.

Signed-off-by: Robert Robinson <robert.robinson@nordicsemi.no>
2025-07-29 11:24:21 -04:00
Fabio Baltieri
b1fccaad6e scripts: check_init_priorities: fix device function name display
Device init pointers have been moved off struct init_entry and into
struct device in 766bfe7b2e, but check_init_priorities.py have not been
modified to check the new pointer so it's been showing NULL for all
devices since.

Fix it by searching down the right pointer for device init entries.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-28 04:22:43 -04:00
Tim Pambor
dff24c8c00 twister: Fix race condition in try_making_symlink
Replaces the check-then-create pattern for symlinks with
opportunistic creation. Instead of checking for existence
before creating the symlink, the code now attempts to
create it directly and gracefully handles the case
where it already exists.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-25 23:30:31 +02:00
Jamie McCrae
6751c85c63 scripts: ci: check_compliance: Add check for zephyr module file
Adds a check which fails CI if a zephyr module file is added to the
zephyr repository itself

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-25 08:13:56 -04:00
Arkadiusz Cholewinski
d021851182 CI: Coverage: Fix: Get component name from testsuite name.
Get component name from testsuite name instead of
testcase identifier.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-07-24 17:00:48 +01:00
Jonathan Nilsen
78a61579d8 west: runners: nrf: don't recover twice on nrf54h
Update the recover mechanism for nrf54h to only call recover
once. Using nrfutil device recover with both --core Network and
--core Application is redundant with IronSide SE as both of these
map to the same operation which does a full erase of the device MRAM.

Additionally, recovering twice in a row specifically in a nrfutil
batch file (which is used by this runner implementation) triggers some
odd behavior with the current latest version of
nrfutil device + IronSide SE, which can cause the device to enter a
reset loop and appear unresponsive and preventing 'west flash --recover'
from working properly.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
eb7239c6a8 west: runners: nrf: Program UICR/PERIPHCONF artifacts if present
Program the new UICR and PERIPHCONF artifacts if they are generated.
These are required for the application to operate properly if they
are in use.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Grzegorz Swiderski
b4c18e8999 boards: nrf54h20dk: Merge iron variants into the base variants
This replaces the legacy SDFW compatible board configuration with the
IronSide SE compatible one, thus removing support for running samples
and tests on nRF54H20 devices with the old firmware.

All applications are expected to work on `nrf54h20dk/nrf54h20/cpuapp`
out of the box. For other board targets, all applications are expected
to boot, but may require additional peripheral configuration in UICR.
Build system support for the new UICR format is to be added separately.

Co-authored-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Pieter De Gendt
b1f398d176 scripts: ci: check_compliance: KeepSorted allow combining strip and re
No reason we couldn't strip a line we want to match to a regex.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-24 06:08:10 -04:00
Chaitanya Tata
ef8bbab600 ci: Add missing nrf_wifi directory
This directory is part of the nRF Wi-Fi driver and should trigger tests.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-24 06:04:00 -04:00
Jamie McCrae
744a5635f9 scripts: ci: check_compliance: Add support for module Kconfigs
Adds support for checking module samples and tests for additional
Kconfigs, as well as logging Kconfigs, so that this check can be
reused more easily with out of tree manifest repos

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-23 17:29:07 +01:00
Tim Pambor
c7e97bb5f8 runners: probe-rs: Support debug and debugserver
Add support for west debug and west debugserver to
the probe-rs runner.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-23 17:28:52 +01:00
Benjamin Cabé
99138170b3 scripts: requirements: remove lxml dependency
No more users of lxml in the tree so drop the 3rd party dependency (it
might still be pulled in by other projects, ex. gcovr).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Benjamin Cabé
65f2833638 scripts: tests: twister_blackbox: drop lxml dependency
No need to rely on lxml for such a simple XML parsing task.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Benjamin Cabé
db47c899e3 scripts: ci: check_compliance: no need for lxml anymore
Remove an old workaround requiring lxml to be present as junitparser was
not working with xml.etree.ElementTree until version 3.0.0.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Benjamin Cabé
82c955ab7c scripts: net: Remove dependency to lxml in enumerate_http_status.py
Using the third party lxml library for the very simple parsing task this
script performs in unnecessary, so switch to Python's built-in
HTMLParser.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Anas Nashif
ac4aabc10d twister: support filtering tests using regex
Use --test-pattern to filter scenarios using regular expressions, for
example:

./scripts/twister --test-pattern '^kernel.semaphore.*' -v

will run all those test using this identifier pattern, and nothing else.
Multiple patterns are possible.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-21 07:23:58 -04:00
Pieter De Gendt
373c0724c9 scripts: ci: check_compliance: Capture failing tests
If a compliance test itself throws an exception, the entire script is
aborted.
Update this by capturing the exception and failing only the test itself.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-21 07:22:26 -04:00
Georgij Černyšiov
e71f79d644 scripts: west: runners: stm32cubeprogrammer: fix E0606 related to dl_file
Initialize 'dl_file' to 'None' before the logic that determines
which binary file to load.

Resolves the E0606 Pylint warning.

Signed-off-by: Georgij Černyšiov <geo.cgv@gmail.com>
2025-07-21 07:22:09 -04:00
Tim Pambor
3d077c68ca scripts: requirements: Remove mock
Remove mock from requirements-actions.in as it is not needed anymore.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-21 06:57:41 -04:00
Tim Pambor
12ba98b2dd scripts: requirements: Add back tomli
Add back tomli to the requirements-actions.txt as it is still used by
some dependencies.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-21 06:57:41 -04:00
Anas Nashif
2f35e68dd8 Revert "scripts: ci: check_compliance: Add support for module Kconfigs"
This reverts commit 6013fc7201.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-19 20:58:31 -04:00
Anas Nashif
9219c81b66 twister: make no-detailed-test-id default
Make this option default and reduce amount of details displayed by
twister.
This options has been enabled in CI for a while now with the intention
of making it default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-19 15:50:47 -04:00
Jamie McCrae
6013fc7201 scripts: ci: check_compliance: Add support for module Kconfigs
Adds support for checking module samples and tests for additional
Kconfigs, as well as logging Kconfigs, so that this check can be
reused more easily with out of tree manifest repos

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-19 15:48:24 -04:00
Benjamin Cabé
53ea49539a scripts: requirements: drop tomli dependency
This dependency is not used anywhere so drop it.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:42:43 -04:00
Benjamin Cabé
edead766dc scripts: requirements: remove dependency to mock package
mock has been available in Python standard lib since Python 3.3, remove
the unnecessary dependency to `mock` pip package.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:42:19 -04:00
Benjamin Cabé
f39ec79806 scripts: tests: apply ruff linting to test_domains.py
Somehow this file had no exclude rules in .ruff-excludes.toml. Make it
compliant going forward.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:42:19 -04:00
Benjamin Cabé
0ed775bfc9 scripts: west_commands: canopen: replace progress by tqdm
progress has been unmaintained for years and tqdm is a more
modern and faster alternative, which is already used by other commands.
Replace progress by tqdm in the canopen_program.py script.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:41:32 -04:00
Appana Durga Kedareswara rao
5e0d266381 runners: xsdb: Add support for optional bl31, pdi, system.dtb arguments
This update enhances the runner script to optionally accept bl31, pdi,
and system.dtb as arguments. These inputs are not mandatory and will
only be used if explicitly provided. This allows for more flexible boot
configurations, especially useful when testing different firmware and
system setups without modifying the script.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2025-07-19 15:38:57 -04:00
Declan Snyder
1f1a2e25b2 scripts: check_compliance: Fix traceback in junitparser
junitparser had a bug causing a traceback when running the checkpatch
check compliance module, fix is in 4.0.1 of junitparser from this PR:
https://github.com/weiwei/junitparser/pull/168

Update requirements to make sure we get this version.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-19 15:34:47 -04:00
Declan Snyder
3b5bfd9f4a scripts: check_compliance: Fix resource leak
The git diff subprocess was leaking, ie.,
it was still running with it's file streams open,
and python was printing warnings about this. Fix by calling
communicate() on the object which will do the cleanup.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-19 15:34:47 -04:00
Luca Burelli
49bf6aad88 dtlib: (cosmetic) use filename and line number on all messages
Take advantage of the new 'filename' and 'lineno' attributes of Node and
Property objects to provide more informative error and status messages
by printing the actual source file reference of the corresponding
object, always using the unquoted file:line format in error messages.

No functional change is introduced by this commit.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-07-19 15:34:13 -04:00