Allow running the test suite locally without creating a west workspace
first. Without the monkeypatch a WestNotFound exception would be raised.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Prevent reuse to trip on "... SPDX-License-Identifier: tag." and
complain about "License may not be allowed:License file for 'tag.'"
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Do not have different sorting based on mode, always sort the same and
run all tests in the same subsets or runnings. A test failing on
multiple platforms should not cause majority of runners to fail.
Also adapt related tests.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add explicit RTS/CTS flow-control options to the Wi-Fi Enterprise
certificate installer.
This makes the script usable with boards and serial adapters that do not
support or expect hardware flow control.
Signed-off-by: Siddhant Modi <siddhant.modi@gmail.com>
Two sources of over-counting caused (hidden) to go negative,
breaking the dashboard sunburst chart:
1. Symbols with SHN_ABS/SHN_UNDEF/SHN_COMMON section indices have
a non-zero st_size but occupy no actual ROM/RAM bytes. Skip them
in get_symbols() before address-range classification.
2. Address aliases were not removed from symbol_dict after
mark_address_aliases() identified them, so generate_any_tree()
counted their size a second time. Remove them from symbol_dict
to match the documented intent of the function.
Fixes#110380
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
The ``WestAppNoRun`` subclass only existed to populate the deprecated
``west.configuration.config`` global so the previous ``get_build_dir()``
could read it. We can now pass a newly constructed configuration as an
optional argument.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The `LicenseAndCopyrightCheck` test was reporting warnings for some image
files while ignoring others. This was caused by modifying the
changed_files list during iteration, leading to inconsistent filtering
of files.
This aligns the implementation with the intended behavior and avoids
spurious warnings on binary files.
Signed-off-by: Elie Carrot <elie.carrot@smile.fr>
This workflow has been running for a while capturing bug state, however,
it is not being used anywhere and right now it is not generating any
useful data given that we changed how we use Github issues for tracking
bugs.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fixes checkpatch not warning when a blank line between a declaration
and a statement is removed by a patch. The check only fired on added
('+') lines, missing violations left as context lines.
Track removed blank lines via a flag and extend the check to also
fire when a blank was deleted immediately before a context line.
Fixes: #98976
Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
default_allow_list_file is not set in the case KCONFIG_ALLOWLIST is set.
In the case of failure, this causes the failure msg itself to throw error.
Signed-off-by: James Growden <jgrowden@tenstorrent.com>
Keep zephyr/edt.pickle when cleaning artifacts for test-only
packages.
Add edt.pickle to the single-domain and multi-domain allow-lists
used by cleanup_device_testing_artifacts(). Update the related
Twister unit tests to match the new retained artifact lists.
Some runners need edt.pickle at flash time to resolve the code
partition from the EDT, so removing it breaks flashing from
packaged device-testing artifacts.
Signed-off-by: Hake Huang <hake.huang@nxp.com>
Drop the deprecated ``from west.configuration import config`` import
from ``build.py`` along with the ``config_get`` / ``config_getboolean``
module-level wrappers. Inline the seven call sites with
``self.config.get('build.<key>', default=...)`` /
``self.config.getboolean('build.<key>', default=...)``, which uses the
dotted-key API exposed by ``west.configuration.Configuration``.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.7
Drop the deprecated ``from west.configuration import config`` import
from ``run_common.py``. Add a keyword-only ``config`` parameter to
``get_build_dir()``, when the caller does not provide one, instantiate a
``Configuration`` from the current workspace.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.7
The module-level ``from west.configuration import config`` import is
deprecated in favour of the ``west.configuration.Configuration`` class
(typically reached via ``self.config`` on a ``WestCommand``).
Drop the deprecated import from ``build_helpers.py`` and add a
keyword-only ``config`` parameter to ``find_build_dir()``. When the
caller does not provide one, fall back to instantiating a
``Configuration`` from the current workspace so out-of-tree behaviour
matches the populated-global path the deprecated import used to follow.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.7
Do not raise exception when exe file was not found,
as it is related with build failure. Allow processing
of exception handling in build stage to keep build.log
in twister report output.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Add opt-in skip-flashed, diff-based flashing, and no-progress
flags, matching esptool defaults (all off). Report the SoC name
from CONFIG_SOC in the flash log. Refactor __init__ to take the
args object since the extra flags pushed it past the 13-argument
limit.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add optional min-len/max-len properties to edtlib spec to specify a valid
length range for array type values. Basically same as 7ddcb93d4a but
for prop length.
Assisted-by: Gemini
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
When west build -T is used without an explicit source directory,
_resolve_test_item() updated self.args.source_dir but not
self.source_dir. The stale value (often CWD) was passed as APP_DIR
to CMake, so sysbuild could load the wrong CMakeLists.txt.
Set self.source_dir alongside self.args.source_dir. Add a regression
test that checks source_dir and APP_DIR point at the sample path,
not CWD.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
Move the --test-item handling block out of do_run() into its own
_resolve_test_item() method. No functional change; preparatory
refactor to make test_item path resolution independently testable.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
The rtsflash runner imported usb.core and usb.util at module level.
When pyusb is not installed, ImportError prevented the runner from
registering and test_runner_imports failed because rtsflash was
missing from the expected set.
Follow the jlink runner pattern: catch ImportError at import time,
set MISSING_REQUIREMENTS, and fail in do_run() with an explicit
install hint when dependencies are needed. Add rtsflash to the
runner imports test expected set.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
Use OpenOCD feature to use a log file instead of printing the logs out,
which west does not show. This permits accessing the OpenOCD logs at all
which are not shown otherwise.
Signed-off-by: Josuah Demangeon <me@josuah.net>
The esp32 runner always passed esptool --after hard-reset. On targets
flashed over the chip built-in USB-Serial/JTAG peripheral (common on
ESP32-S3, C3 and C6 boards with no external USB-to-UART bridge),
hard-reset relies on an RTS line that does not exist, so esptool cannot
perform a real system reset. After a successful flash the chip reboots
back into download mode and does not start the application until it is
power cycled. There was no way to choose a different reset method.
Advertise the generic reset_types runner capability so users can select
the esptool post-flash reset with: west flash --reset-type watchdog-reset.
This is the method Espressif documents for USB-Serial/JTAG targets that
get stuck in download mode. The supported values are hard-reset (the
default, behavior unchanged) and watchdog-reset. This uses the same
RunnerCaps mechanism that the jlink and stm32cubeprogrammer runners
already use, so no esp32 specific option is needed.
The default path is unchanged. When reset is disabled with --no-reset,
an explicitly requested reset type is ignored with a warning. A runner
test covers the default and watchdog-reset values and the --no-reset
interaction, and a note is added to the Espressif programming and
debugging documentation.
Assisted-by: Claude Code:claude-opus-4
Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
kernel.h implies kernel_structs.h via kernel_includes.h, making
explicit inclusion of kernel_structs.h unnecessary whenever kernel.h
is already included in the same translation unit.
Remove the redundant includes across arch, boards, drivers, kernel,
lib, samples, subsys, and tests trees.
in include/zephyr/kernel_structs.h:
* 2. kernel.h shall imply kernel_structs.h, such that it shall not be
* necessary to include kernel_structs.h explicitly when kernel.h is
* included.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The ``west.log`` module is deprecated. Drop it from every module under
``scripts/pylib/zspdx/`` and switch to standard Python
``logging.getLogger(__name__)`` instead. The reusable
``forward_logging_to_west()`` bridge wired up in ``spdx.py``routes
records emitted under the ``zspdx`` logger tree back to the command's
``self.dbg/inf/wrn/err/die``.
Call-site mapping:
log.dbg -> _logger.debug
log.inf -> _logger.info
log.wrn -> _logger.warning
log.err -> _logger.error
``except ... as e: log.err(..., str(e))`` pairs are simplified to
``except ...: _logger.exception(...)`` which already includes the
exception text and traceback.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.7
In preparation for migrating the ``zspdx`` package away from the
deprecated ``west.log`` module, wire the reusable
``forward_logging_to_west()`` helper (from ``build_helpers.py``) so any
record emitted under the ``zspdx`` logger tree is routed back to this
command's ``self.dbg/inf/wrn/err/die`` and obeys ``west -v`` / ``west
-vv``.
Disable propagation on the ``zspdx`` parent logger so records do not
double-emit via any handler attached to the root logger.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.7
Add support to build required_applications for a given test
automatically. Users no longer need to manually specify them
on the command line with -T and -s options.
If a required application is not found in testsuites, Twister
searches for it in the same directory as the tests.yaml file.
A new `path` field in required_applications and required_devices
allows specifying an explicit search directory.
Rename the 'name' field to 'application' in required_applications
to align the API with required_devices which already uses
'application'. The old 'name' field is kept for backward
compatibility but marked as deprecated with a runtime warning.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Fix devicetree coding style regarding whitespaces through the tree.
This affects code snippets inside documentation, comments, error messages
as to encourage a style that passes CI. Follow-up of #101619
Signed-off-by: Josuah Demangeon <me@josuah.net>
Updates the gen_kobject_list.py build script to mark both
the first and last of the K_OBJ_DRIVER_xxx entries. This
sets the stage to allow for driver object checking.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Replace the direct subprocess.run() call with run_cmake() from zcmake.py,
which is the standard cmake wrapper used by other west commands. This adds
cmake version validation and consistent error reporting.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
The GIC register banks are now mapped by the arm64 arch core
(arch/arm64/core/mmu.c), so a hand-written GIC entry in an arm64
mmu_regions.c is redundant. Flag those entries, detected via the arm64
arm_mmu.h include, while leaving aarch32 -- which still maps the GIC in
the SoC -- and the GICv3 ITS -- a separate node the arch core does not
map -- untouched.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Parametrize the OpenOCD RTOS gate tests over debugserver and debug so
both command paths that emit the optional Zephyr RTOS awareness command
are covered.
Signed-off-by: Andrii Anoshyn <anoshyn.andrii@gmail.com>
OpenOCD's Zephyr RTOS awareness ('$_TARGETNAME configure -rtos Zephyr')
is only implemented for the cortex_m, cortex_r4, hla_target and arcv2
target architectures. supports_thread_info() only checked the OpenOCD
version, so with CONFIG_DEBUG_THREAD_INFO=y the runner appended the
command unconditionally. On other architectures (e.g. RISC-V, Xtensa)
OpenOCD then aborts with "Could not find target in Zephyr compatibility
list", which 'west debug' surfaces as a silent timeout.
Add target_supports_rtos(), which checks the build configuration for
CONFIG_CPU_CORTEX_M, CONFIG_CPU_AARCH32_CORTEX_R or CONFIG_ISA_ARCV2,
and only append the -rtos command when the architecture supports it.
print_gdbserver_message() now reports that thread info is unavailable on
the architecture instead of implying it is enabled.
Add tests covering the arch gate and the existing version gate.
Fixes: #108804
Signed-off-by: Andrii Anoshyn <anoshyn.andrii@gmail.com>
scripts/west_commands/build_helpers.py used `logging.getLogger(__name__)`,
which resolves to the bare string 'build_helpers' since the module is
loaded as a top-level script. That name collides with
scripts/pylib/build_helpers/domains.py, which grabs the same logger at
import time and attaches its own StreamHandler -- defeating the
hasHandlers() guard in forward_logging_to_west and causing
domains.py's handler to print records on our behalf, in its format.
Use an explicit flat name 'zephyr_build_helpers', exposed as a
BUILD_HELPERS_LOGGER constant so the three forward_logging_to_west
callers in build.py, run_common.py and sign.py share a single source
of truth. The name deliberately stays out of the 'west.*' namespace,
whose NullHandler would also defeat hasHandlers().
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add a logging bridge in build_helpers.py: WestLogHandler forwards
Python logging records to a WestCommand's inf/wrn/err/dbg methods,
and forward_logging_to_west(command, names) attaches one to the named
module loggers. Convert build_helpers / zcmake / run_common's
remaining log.X calls to the equivalent _logger methods, and have
each west command that calls into these helpers (build, export, sdk,
sign, run_common's entry points) call forward_logging_to_west on
entry so the records obey `west -v` / `west -vv`.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
In run_common.py and zcmake.py helpers without a WestCommand in scope,
swap `log.die(msg)` for `sys.exit(msg)` -- same
observable behavior (message to stderr, exit) without needing a
command instance.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Swap log.{die,err,wrn,inf,dbg} in run_common.py for the equivalent
methods on the invoking WestCommand. Translate the associated constants:
log.VERBOSE_VERY becomes Verbosity.DBG_MORE.
Pass the command instance the functions to dump.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The build command does not declare a `--verbose` argument of its own;
`self.args.verbose` only ever appears when west's top-level parser
injects it, which is not a stable contract. Use `self.verbosity`
(the WestCommand's own level) to decide whether to forward verbose
flags to the underlying build system.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add a script that looks at areas and identify test identifier per area.
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Temporarily disable qemu with robot. Some qemu jobs are not being
terminated correctly slowing CI execution.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Rename nrf5340_cpunet_iso to extra-iso so that the
configurations is reusable across nRF SoCs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Having an interface library named "mbedTLS" and the real library named
"mbedtls" (as provided by the Mbed TLS module) is misleading.
This commit replaces:
- mbedTLS -> mbedtls_iface for the CMake library. "mbedTLS" is still
available as alias to "mbedtls_iface" for backward
compatibility, but this should be removed in the future.
- mbedTLS -> Mbed TLS in comments and documentation.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>