Commit graph zephyr/scripts
Author SHA1 Message Date
Anas Nashif
034937ea9c twister: on load_errors, abort early
With no tests found when pointing to a directory with no tests, which is
not wrong, we were exiting with 1, when twister was crashing because of
bad syntax or when not able to load a python module, same thing.

Now fail early when there are schema errors or other issues, and fail
with a warning when no tests are found, which should be fine given that
a warning is emitted, but not an error.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-30 07:42:25 -05:00
Pieter De Gendt
ae55454cc3 ci: check DCO sign-off with a dedicated workflow
Add a dco.yml workflow that runs the action-dco composite action over a
pull request's commits, verifying each carries a Signed-off-by line
matching the author (First Last <email>) as required by the DCO.

Drop the now-redundant Identity compliance check, along with its
.gitignore output entry and the dependabot exclude in compliance.yml.
The empty-body check it also did stays covered by gitlint's
body-is-missing rule.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.8
2026-07-30 09:52:32 +02:00
Omar Naffaa
fd701acfe6 scripts: dts: Loosen type annotation on "val"
Update "out_dt_define" macro to allow integer types
as the value parameter. Prevents unneeded warning
when "val" is specified as an integer.

Signed-off-by: Omar Naffaa <onaffaa@qti.qualcomm.com>
2026-07-28 18:11:22 -04:00
Nikodem Kastelik
d959c961ff scripts: requirements: pin tree-sitter below 0.26
tree-sitter 0.26.0 corrupts memory when traversing nodes from the
tree-sitter-cmake grammar, causing cmake_style.py to segfault. This is
reproducible by running the checker on
modules/hal_nordic/nrfx/CMakeLists.txt:
  scripts/cmake/cmake_style.py modules/hal_nordic/nrfx/CMakeLists.txt
Cap the dependency at <0.26 and pin the lock back to the working 0.25.2.

Assisted-by: Claude:opus-4.8
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2026-07-28 11:32:36 +01:00
Juergen Werner
2dfdec7f37 scripts: import sys was removed from guiconfig.py but is still in use
This is a recent regression from commit e95e5b8.

Signed-off-by: Juergen Werner <j.werner@aduart.de>
2026-07-27 14:42:58 +02:00
Anas Nashif
f75eaf5733 scripts: twister: skip valgrind blackbox test when valgrind is missing
Twister exits with an error when --enable-valgrind is given but the
valgrind executable is not on PATH. The blackbox test calls twister
in-process, so that exit propagated as SystemExit and failed the test
on hosts without valgrind installed.

Add a requires_tool() helper to the blackbox conftest that builds a
skipif marker from shutil.which(), and apply it to the valgrind
parametrization. The baseline case without the option is unaffected and
still runs everywhere.

Assisted-by: Claude:opus-4.8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-27 09:21:02 +02:00
Anas Nashif
d9b07f41d9 scripts: twister: refactor blackbox tests
Replace the importlib-based module loader pattern used across blackbox
tests with direct calls to twister_main(), and overhaul the shared
conftest.py: rename fixtures for clarity, isolate logging state via a
dedicated _reset_logging() helper and autouse fixture, add helper
functions read_testplan(), active_testcases(), and active_testsuites(),
and introduce session-scoped hello_world_elf and out_path fixtures.
Add pytest markers fast, build, and run. Rename test_filename_mock to
TEST_FILENAME_MOCK and resolve TEST_DATA through os.path.realpath() to
avoid symlink mismatches. Delete test_addon.py and restructure
test_config.py and test_coverage.py into focused classes grouped by
feature.

Assisted-by: Claude:opus-4.8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-27 09:21:02 +02:00
Anas Nashif
2e55626785 scripts: twister: derive the CMake generator from the parsed arguments
The default for --ninja was computed from sys.argv:

    default=not any(a in sys.argv for a in ("-k", "--make"))

sys.argv is the process argument list, which only coincides with the
argument list twister acts on when twister runs as a CLI. Calling
twister_main(args) in-process, as the blackbox tests do, therefore
selects the generator based on whatever launched the interpreter:

  - twister_main(['--make', ...]) still builds with Ninja, silently
    ignoring --make.
  - Running the blackbox suite as 'pytest -k <expr>' puts '-k' into
    sys.argv, so every build switches to Unix Makefiles.

Drop the sys.argv sniffing and derive options.ninja from options.make
after parsing, so the generator follows the arguments twister was
actually given.

Assisted-by: Claude:opus-4.8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-27 09:21:02 +02:00
Anas Nashif
b95c99d979 scripts: twister: cache version, toolchain and platform lookups
Add process-level caches to TwisterEnv.check_zephyr_version() and
get_toolchain() so repeated twister_main() calls within the same
process skip slow git/cmake subprocess re-runs, and add a module-level
cache to generate_platforms() keyed on the board/soc/arch root tuples.
This significantly speeds up in-process invocations such as the
blackbox test suite.

Assisted-by: Claude:opus-4.8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-27 09:21:02 +02:00
Reto Schneider
07eddea693 twister: Deal with trailing slash in outdir
This change allows the following command to be run more than once
without crashing:

> twister --outdir directory-with-trailing-slash/

Without this fix, the 2nd run would abort with an error like this:

> shutil.Error: Cannot move a directory 'directory-with-trailing-slash/'
> into itself 'directory-with-trailing-slash/.1'.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2026-07-26 20:47:45 +02:00
Henrik Brix Andersen
c5c18b66af scripts: requirements: actions: basic: refresh pinned versions
Run the uv command to update the pinned versions in
requirements-actions-basic.txt.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-07-26 08:14:41 -04:00
Henrik Brix Andersen
1115f8c572 scripts: requirements: actions: refresh pinned versions
Run the uv command to update the pinned versions in
requirements-actions.txt.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-07-26 08:14:41 -04:00
James Growden
f415f80cbd runners: pyocd: add reset
Add the ability for the pyocd runner to reset the device.
Add pytest to cover use case.

Signed-off-by: James Growden <jgrowden@tenstorrent.com>
2026-07-24 12:40:05 -07:00
Grzegorz Chwierut
a18fd195bf twister: harness: handle missing robot executable
When the Robot Framework executable is not found, subprocess
raised an unhandled FileNotFoundError that aborted the entire
Twister run instead of just the affected test.

Catch the exception in the Robot harness, mark the instance as
skipped with a descriptive reason, and continue so remaining
tests still execute.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2026-07-24 12:39:50 -07:00
Anas Nashif
97070087f8 ci: set_assignees: diff manifest/maintainers against PR fork point
The assigner compared the PR's west.yml and MAINTAINERS.yml against the
checked-out base-branch tip. For pull_request_target the working tree is
the base branch HEAD, while pr_west.yml/pr_MAINTAINERS.yml come from the
asynchronously-recomputed pull/<N>/merge ref, whose base can lag well
behind that tip. The diff therefore reported not only the projects/areas
the PR actually changed but also everything that advanced on the base
branch after the PR was created, and added all of those maintainers and
collaborators as reviewers.

Compare instead against the merge ref's first parent (FETCH_HEAD^1), the
base the merge was computed from, so the diff isolates exactly the PR's
own changes regardless of how stale the merge ref is. The workflow now
writes base_west.yml and base_MAINTAINERS.yml from FETCH_HEAD^1 and
passes them via the new --base-manifest and --base-maintainer-file
options. Both options default to the checked-out files when omitted, so
local and manual invocations keep working.

Fixes #110422

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-24 15:34:04 -04:00
Alberto Escolar Piedras
e158bdf5d3 twister: reports: Also report toolchain in synopsis shortlist
Now that we are building with multiple toolchains some failures will only
happen with one toolchain.
So, also print the toolchain used, so it is easier to identify the issue.

And update the twister blackbox tests reference data.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-07-23 18:01:27 -04:00
Alberto Escolar Piedras
60643b7b05 twister: script harness: Properly log script not found failures
Before this patch, when a script is not found, `twister_harness.log` would
not be created.

This would result in the error reporting in runner.py to refer users to
the build.log; and if `--inline-logs` was used, it would inline the
build.log in the console output which was just a lot of confusing noise
for users.

Instead let's create twister_harness.log logging a "not found" error.
So we both refer users to it in the console output, and if we inline
anything we inline that.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-07-23 16:09:16 +02:00
Anas Nashif
788f7ae977 ci: test_plan_v2: load ci configuration.
add --test-config tests/test_config_ci.yaml when executing twister
during generation of test plan, so we can get the coverage based on the
configuration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-22 20:57:44 -04:00
Anas Nashif
00b73e03a4 twister: allow building a platform with multiple toolchains
Twister picks exactly one toolchain per platform, so a board that is
buildable with several toolchains only ever gets coverage for one of
them. The only way to build a test more than once was the test scenario
level integration_toolchains option, which cannot express "build
everything on this platform with both GCC and Clang".

Add a build_toolchains option listing the toolchains every test assigned
to a platform should be built with. Twister then creates one test
instance per toolchain, each in its own build directory. The option can
be set in the board configuration, or per platform in the twister
configuration file, which lets multi-toolchain coverage be enabled for
CI only while local runs keep building each test once. An empty list in
the twister configuration disables it for a platform that requests it.

The toolchain resolution chain moves into get_toolchains(), keeping the
existing precedence, with build_toolchains taking effect just below a
scenario's integration_toolchains.

Toolchain is also added to the platform_key deduplication key. That key
deduplicates platforms, not toolchains, and without this every extra
toolchain of a scenario using platform_key is discarded as already
covered.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-22 20:57:44 -04:00
Alberto Escolar Piedras
a945d0ee03 twister: Do not print twice logs with inline_logs for script harness
For `script` type harnesses, when `--inline_logs` is used,
the output of all the scripts which are part of the test are printed
to console first (both passed and failed ones).
And then again the failed ones.
This is quite undesirable, as it fills the console with unnecessary
logs, which makes it more difficult and slow to find the problem.

Instead, for the script harness, let's print only the failed ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-07-21 10:14:49 -04:00
Alberto Escolar Piedras
dc3634992c twister: runner/reports: Correct log variable name
The pytest harness now is a child of the script harness.
And all script harnesses use twister_harness.log for their
output.
Let's correct the variable name to not confuse readers.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-07-21 10:14:49 -04:00
Fin Maaß
71aadac132 dts: tests: allow cpu props be set in cpus
Add a test to check that putting common
cpu props in the parent cpus node works.

Assisted-by: GitHub Copilot:GPT-5.3-Codex

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-20 17:30:37 -05:00
Fin Maaß
11dc56c5c7 dts: allow cpu props be set in cpus
This allows to put common props of
cpu nodes in the parent cpus node, as
specified in the devicetree spec in 3.8.

Assisted-by: GitHub Copilot:GPT-5.3-Codex

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-20 17:30:37 -05:00
Anas Nashif
ff848277b8 twister: add the virtiofs sidecar
Add the first concrete sidecar. It shares a host directory with the
guest over virtiofs: tests run on QEMU with a vhost-user-fs-pci device,
which needs a virtiofsd daemon on a per-build-dir UNIX socket that QEMU
connects to before it boots. The sidecar starts virtiofsd in setup()
(seeding a private writable copy of the shared directory) and stops it
in teardown(), skipping the run cleanly if virtiofsd is not installed.
The runner injects the dynamic -chardev socket path via
QEMU_EXTRA_FLAGS.

Configured through the virtiofs_shared / virtiofsd_bin /
virtiofs_extra_args harness_config keys. Adds unit tests.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-20 08:33:51 -05:00
Anas Nashif
12aeb999ea twister: introduce the host-sidecar concept
Some QEMU tests need a host-side process running for the guest to talk to
(a virtiofsd daemon, an ivshmem reader, a network tap). Model this as a
first-class "sidecar": a testsuite field orthogonal to the harness, so a
test keeps its normal harness (ztest, console, ...) and just declares a
sidecar, and twister may also attach one itself.

This commit adds only the plumbing and the base concept:

- A Sidecar base class with configure()/setup()/teardown() and a
  SidecarImporter registry (empty here; concrete sidecars register in
  later commits), in twisterlib/sidecar.py.
- The `sidecar:` testsuite field (config_parser, TestSuite) and the
  per-instance sidecar/dtc_overlay attributes (TestInstance).
- The runner wraps handler.handle() with the sidecar's setup/teardown and
  skips the run cleanly if setup() reports the host side is unavailable.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-20 08:33:51 -05:00
Omar Naffaa
68708d45c6 scripts: add device_type as binding exception
"device_type" is a yaml property that needs to use an underscore
rather than a dash. This is a special case to maintain compatibility
with legacy FCode devicetrees and should not be flagged.

Signed-off-by: Omar Naffaa <onaffaa@qti.qualcomm.com>
2026-07-20 08:30:45 -05:00
Reto Schneider
1938e2061f scripts: footprint: Improve function name
The previous function name was a bit misleading, as the actual work it
does it using "git reset", not "git checkout".

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2026-07-17 13:32:16 -05:00
David Nepožitek
88d6d91753 scripts: zspdx: Fix relationship mapping in SDPX 3
Add translation of DEPENDENCY_OF, CONTAINED_BY, DESCRIBED_BY,
and PREREQUISITE_FOR to SDPX3 relationships. Fix HAS_PREREQUISITE
to be mapped as hasPrerequisite relationship.

Signed-off-by: David Nepožitek <david@nepozitek.cz>
2026-07-17 11:56:06 -04:00
Appana Durga Kedareswara rao
f86e46fe61 west: xsdb: Document AMD host tool and harden runner tests
- Add XSDB subsection to Flash & Debug Host Tools (Vitis/PATH, not SDK)
- Raise a clear MissingProgram message when xsdb is absent
- Patch require() in the remaining unit tests so CI does not need xsdb
  installed

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2026-07-17 08:42:21 +02:00
Appana Durga Kedareswara rao
67a8b58d15 runners: xsdb: Add native debugging with board config integration
Enable native XSDB interactive debugging using board-specific xsdb.cfg
files for automatic target selection and platform initialization.

- Add do_debug_native() for interactive debugging
- Auto-detect board config from support/xsdb.cfg
- Prevent auto-execution to enable breakpoint debugging
- Add --hw-server for remote board support
- Display XSDB command reference on startup

Splitting do_run() into do_flash()/do_debug_native() adds an explicit
self.require('xsdb') check on the flash path, which do_run() did not
have before.

The generated debug parameter file reuses the same ordered key/value
"boot_arg" list as flashing, so a native debug session loads the
identical set of boot artifacts, in the same board-defined order, as
a flash.

Boards with multi-stage bring-up (e.g. zynqmp_apu/zynqmp_rpu running
FSBL or PMUFW before the final application load) call "con" one or
more times before the load that should stay paused for breakpoints.
Only the LAST standalone "con" and "exit" in the board cfg are
neutralized, so earlier bring-up stages still run to completion.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2026-07-17 08:42:21 +02:00
Appana Durga Kedareswara rao
29ecb2f695 runners: xsdb: Pass boot artifacts to xsdb.cfg as key/value pairs
Board xsdb.cfg/xsdb_cfg.tcl scripts previously read their boot
artifacts (bitstream, FSBL, PDI, bl31, system.dtb, PMU firmware) as
positional arguments. That only works if every artifact lands in
exactly the position each board's load_image proc expects, which
breaks down as soon as two boards disagree on the set or order of
artifacts they take (e.g. PDI-based Versal boots vs. bitstream+FSBL
ZynqMP/Kria boots), and gives boards no way to validate what they
were actually given.

Give each board a small shared parse_args helper
(boards/amd/common/xsdb_parse_args.tcl, sourced by every board's
xsdb.cfg/xsdb_cfg.tcl instead of duplicating it 11 times) that turns
argv into an associative array from explicit "key value" pairs,
validating required/optional/unknown keys with a clear Tcl-level
error. The west runner builds that flat key/value list instead of a
positional one; order no longer matters, and each board only has to
declare the keys it understands. Every artifact keeps the exact
required/optional status it had before this change: bl31 stays
required on versal_apu/versal2_apu/versalnet_apu (previously loaded
unconditionally, no presence check), and bitstream/FSBL/bl31/PMUFW
stay optional wherever they were guarded by a "string length" check
(zynqmp_apu, zynqmp_rpu, kv260_r5).

Also add a generic, repeatable "--param NAME VALUE" option for
anything not covered by the existing --bitstream/--fsbl/--pdi/--bl31/
--system-dtb/--pmufw options -- e.g. "--param pl_pdi <path>" to
program a PL PDI (FPGA fabric) on boards whose xsdb.cfg declares a
"pl_pdi" parameter. Repeated --param calls sharing a NAME are merged
into one space-joined Tcl list value, since Tcl's "array set" would
otherwise keep only the last value for a duplicate key; this lets
partial-reconfiguration designs load any number of PL PDIs, in order,
without the runner needing to know about that use case specifically.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2026-07-17 08:42:21 +02:00
Appana Durga Kedareswara rao
bc6e8fe33c scripts: west_commands: xsdb: Simplify test_xsdb.py test case data
TEST_CASES repeated every field as an explicit None in every case even
when unused, which is not needed: dict.get() already returns None for
an absent key. Each case now only lists the keys it overrides, and the
two runner-construction tests read the rest via tc.get(key). No
behavior change.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2026-07-17 08:42:21 +02:00
Minyuan Xue
1f52424973 ci: test_plan_v2: fix ManifestStrategy crash on unchanged revisions
ManifestStrategy.analyze() returned set(manifest_files) - the set of
consumed filenames - as the calls list when west.yml changed but no
project revision differed (e.g. an unrelated field or formatting
edit). TestPlanOrchestrator.run() iterates calls and accesses
call.full_run, so a plain filename string raised:

  AttributeError: 'str' object has no attribute 'full_run'

This affects any PR that touches west.yml without bumping a project
revision, independent of the actual manifest change. Return an empty
calls list instead, and add regression tests covering both the
no-revision-change and revision-change paths.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Minyuan Xue <minyuan_xue@realsil.com.cn>
2026-07-16 10:52:02 -04:00
Tim Pambor
d7ba1048cb Revert "scripts: pylib: make jsonschema import in domains optional"
This reverts commit 26ad9ce22e.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-07-16 10:50:15 -04:00
Anas Nashif
28c05923ff twister: coverage: fail clearly on an empty tracefile merge
When no per-instance tracefiles exist, the merge stage built an lcov
command with just --output-file and no action option, which lcov rejects
with an opaque "capture report stage failed with 255".

Report the missing tracefiles instead.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-16 10:49:47 -04:00
Perry Naseck
e00b9fcc50 bossac: Fix bossac flash for mapped-partition (closes #107855)
This commit fixes bossac flashing for mapped-partition where
CONFIG_FLASH_LOAD_OFFSET is not available. Instead we rely on
flash_address_from_build_conf() and walk up the devicetree to
find the base address to subtract.

Assisted-by: Claude:claude-opus-4.8

Signed-off-by: Perry Naseck <pnaseck@media.mit.edu>
2026-07-16 10:45:13 -04:00
Fin Maaß
add5c1ccef dts: add test for dependency-mode
Add a test for dependency-mode.

Assisted-by: Github Copilot:GPT-4.1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-16 10:43:34 -04:00
Fin Maaß
8d3f746994 dts: ethernet: use dependency-mode for phy-handle
Move `phy-handle` to use the dependency-mode prop
key instead of the hardcoded code.

Because all ethernet drivers only need to use the
phy-handle in the iface init, we can ignore the
phy-handle dependency completly instead of only
ignoring it if the phy-handle pointing to a child
node of the ethernet node.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-16 10:43:34 -04:00
Fin Maaß
e29a7d2a22 dts: add dependency-mode prop key
add dependency-mode prop key, so it can be
changed what dependency a phandle
in the dt introduces. With this it can be set
in the dt binding that a phandle is f.e. ignored
when the dt ordinal is calculated.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-16 10:43:34 -04:00
Flavio Ceolin
40565427e1 coccinelle: Add script to detect redundant casts in syscall handlers
Add a Coccinelle script that detects and removes redundant pointer casts
in z_vrfy_* functions, where a parameter is forwarded to z_impl_* with
an identical cast.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-15 19:04:12 -04:00
Antoni Duda
557ab2460e doc: allow passing extra twister flags during hw features generation
There currently is no way to modify behaviour of twister during hw
features generation.

For example we run into an issue were we hit Out Of Memory errors on our
doc build instance, and wanted to modify --jobs. This adds an option
zephyr_twister_extra_flags to allow for supplying additional flags.

Signed-off-by: Antoni Duda <antoni.duda@nordicsemi.no>
2026-07-15 14:47:06 -05:00
Anas Nashif
0bd807ceeb Revert "twister: Colorize console log output"
This reverts commit 90555a1fe7.

This causing issues with CI due to missing colorlog module when PRs are
based on old state of main.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-14 21:42:50 -07:00
Anas Nashif
112d85d1de twister: de-duplicate reason strings and status colouring in runner
The 'Incorrect status assignment' reason was repeated across nine
pipeline stage handlers and 'runtime filter' twice; promote both to
module constants. report_out() also rebuilt four near-identical coloured
count sections inline; extract a _colored_count() helper. No behaviour
change; the colour output is verified byte-identical to the previous
formula.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-14 16:40:09 -04:00
Anas Nashif
1bf0dcde08 twister: replace ExecutionCounter boilerplate with a descriptor
ExecutionCounter declared 22 shared counters, each with an identical
property getter, setter and _increment() method - roughly 300 lines of
copy-pasted lock handling. The duplication also hid a bug: the
notrun_cases setter locked and wrote the unrelated _notrun Value instead
of _notrun_cases, so assigning notrun_cases corrupted notrun and left
notrun_cases unchanged.

Introduce an AtomicCounter data descriptor that owns the locked get/set
and increment logic. Each counter is now a single class attribute, and
the <name>_increment(value=1) methods are synthesised on demand via
__getattr__, preserving the existing public API. This removes ~265 lines
and eliminates the setter bug class entirely.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-14 16:40:09 -04:00
Anas Nashif
fc599d0e3e twister: share the status property via a StatusMixin
TestCase, TestSuite and TestInstance each defined a byte-identical
status property/setter validating assignments against TwisterStatus and
raising StatusAttributeError. Extract the shared logic into a StatusMixin
in statuses.py and have the three classes inherit it, dropping the now
unused Enum and StatusAttributeError imports.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-14 16:40:09 -04:00
Lukasz Fundakowski
90555a1fe7 twister: Colorize console log output
Use colorlog's `ColoredFormatter` for Twister's console formatter in
both timestamped and non-timestamped modes to improve readability
without changing file log formatting.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2026-07-14 09:54:20 -04:00
Graham Roff
18fc4eca4e scripts/kconfig: kconfiglib: support running on Windows
Currently the testsuite does not execute succesfully on Windows due to
various issues including path separator mismatch, shell command
incompatibility, and lack of proper symlink support. Fix these issues to
allow running the testsuite on Windows. Note that the compatibility
and symlink tests are skipped due to basic incompatibility.

Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
(cherry picked from kconfiglib commit b8535af53f0650a69e52db4bf8585c09d55852e7)
2026-07-14 09:52:40 -04:00
Graham Roff
19c29291c5 scripts/kconfig: support conditional deps using "depends on A if B"
Extend the "depends on" syntax to support conditional dependencies
using "depends on A if B". While functionally equivalent to "depends
on !B || A", "depends on A if B" is much more readable.

This change is implemented by converting the "A if B" syntax into the
"!B || A" syntax during "depends on" token processing.

Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
(cherry picked from kconfiglib commit d13e125024ec1c8e573aacd463765d028515503e)
2026-07-14 09:52:40 -04:00
Benjamin Cabé
e95e5b8349 scripts/kconfig: drop support for Python 2.x as it is very much EOL
A follow-up to b96a5ad562deffa697d966c29546650aae645f48 where we stopped
having CI run tests on Python 2.x. This actually drops the few remaining
Python 2.x compatibility bits as Python 2.x has EOL'd a long time ago.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
(cherry picked from kconfiglib commit 24aef157aead07f813f874f43ee471b057e622cb)
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
2026-07-14 09:52:40 -04:00
Benjamin Cabé
2e059fae7a ci: doxygen: fail on new top-level API groups
A Doxygen group with no parent becomes a top-level entry of the API
index, which is meant to hold only a handful of broad categories. Add a
check comparing the top-level set against an allowlist, failing both on
new entries and on allowlisted groups that are no longer top-level.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.8
2026-07-14 09:52:31 -04:00