Order reg and ranges before address and size cell properties in the
devicetree test fixture. Reorder CPU properties and the power-states node
to match the devicetree linter's ordering rules.
The linter checks the entire fixture when it changes, so existing
ordering issues also prevent the compliance workflow from passing.
Verified with all compliance checks and 110 python-devicetree tests.
Compliance reports only existing license-header warnings and the disabled
DeviceMmioCheck.
Assisted-by: opencode:gpt-6.1-sol
Signed-off-by: Dev Joshi <devbhave@qti.qualcomm.com>
Add three related pieces to edtlib:
1. edt.cpus: a new public list[Node] attribute on EDT, populated in
_init_nodes() with every /cpus/cpu@N node in DTS source order.
Identification is structural (child of /cpus whose name without unit
address is "cpu", per DT spec v0.4 section 3.8) so it works regardless
of whether the node has a compatible property.
2. cpu.yaml fallback: EDT._cpu_fallback_binding() locates cpu.yaml in
the already-built _binding_fname2path map and loads it as a Binding
with require_compatible=False. The result is cached in a per-EDT
self._cpu_binding instance attribute (lazily on first call). Any
/cpus/cpu@N node that has no compatible and no parent child-binding
receives this binding instead of None, giving it typed properties
(including the device_type: "cpu" default) without requiring a
compatible string. Each EDT instance has its own cache, so two EDT
objects with different bindings_dirs are fully independent.
3. _is_cpu_node() helper: a module-level predicate encoding the same
structural check used by both _init_nodes() and the fallback hook in
Node._init_binding().
Add edtlib tests for edt.cpus, the cpu.yaml fallback, and the CPU
binding type consistency check.
This fixes Infineon cat1b CPU nodes in dts/arm/infineon/ that have no
compatible property and previously had _binding = None, leaving their
properties untyped and inaccessible to edtlib consumers.
Assisted-by: Claude:claude-sonnet-5.5
Signed-off-by: Dev Joshi <devbhave@qti.qualcomm.com>
Add a new property type to the Zephyr binding system. A var-uint64
property accepts 1 cell (32-bit) or 2 cells (64-bit, high word first)
in DTS, assembles them into a single Python int, and emits a plain
integer literal for DT_PROP, identical in shape to type: int.
This is the prerequisite for supporting both 32-bit and 64-bit encodings
of clock-frequency and timebase-frequency in cpu.yaml. The existing
type: int only accepts a single 32-bit cell, while modeling these
properties as type: array would break all existing scalar DT_PROP call
sites.
Key properties of the new type:
- 1-cell DTS value <N>: val = N (32-bit integer)
- 2-cell DTS value <hi lo>: val = (hi << 32) | lo (64-bit integer)
- 3+ cells: EDTError naming the property and cell count
- const:, default:, min:, max: constraints all work on the assembled
integer value
- min-len:/max-len: are rejected (var-uint64 is a scalar,
not an array)
- DT_PROP emits a plain integer literal (no braces, no array)
- DT_PROP_LEN is not generated
Changes:
- edtlib.py: add var-uint64 to ok_types, const_types, min/max allowed
types, ok_default(); add _prop_val() assembly branch
- gen_defines.py: add var-uint64 branch in prop2value()
- test-bindings/var-uint64.yaml: new test binding
- test.dts: add var-uint64-node exercising all constraint types
- test_edtlib.py: 4 new tests (value assembly, 3-cell error, min
violation, binding validator rejection of min-len)
- bindings-syntax.rst: add var-uint64 to schema template
and type table
- kconfigfunctions.py: dt_node_int_prop_int/hex accept property types
whose value is a single integer (int, var-uint64)
- preprocessor-functions.rst: document accepted types for the two
functions
- release-notes-draft.rst: document the new binding property type
Assisted-by: Claude:claude-sonnet-5.5
Signed-off-by: Dev Joshi <devbhave@qti.qualcomm.com>
checkpatch.pl searches for .checkpatch.conf in $CWD, $HOME and
$CWD/.scripts. Allow passing a single directory via CHECKPATCH_CONFIG_DIR
environment variable (empty value is ignored). This allows to directly
use project configuration file for projects which vendored checkpatch.pl
(e.g. LTP or u-boot).
Although it'd be more convenient for user to have --conf-dir option
(instead of using environment variable), code would get ugly because
options from the configuration file needs to be read before processing
command line options with Getopt::Long.
While at it, document directories and environment variable in -h help
and HTML doc.
Link: https://lore.kernel.org/20260421211408.383972-1-pvorel@suse.cz
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[aric: drop Documentation/dev-tools/checkpatch.rst hunk, not in Zephyr]
(cherry picked from commit 2ddfdfe1ad31ba5be5a1c3b4b2b950cf6b6d7c35)
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
With --retry-failed, add_tasks_to_queue() resets the status of a failed
instance before queueing it again, but leaves the per-testcase statuses
from the failed attempt in place.
When the first attempt fails before any output is seen (for example
"Timeout during flashing" on a hardware target), every testcase is
marked blocked. On the retry, only cases that print a result are
updated. Cases that never report, such as ztest cases compiled out of
the image for the current configuration, keep the stale blocked status
and reason, so twister.json shows blocked testcases inside a suite whose
final status is passed. A clean run without a retry reports no status
for those same cases.
Clear the status, reason, duration and output of every testcase after
removing the previous attempt from the status counts, so a retried run
reports the same testcase results as a run that passed first time.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
check_no_undef_outside_kconfig() runs git grep on the repository being
checked without ignore_non_zero=True. git grep exits 1 when nothing
matches, so on a repository without SB_CONFIG_ references, such as a
downstream application, git() calls sys.exit() and SysbuildKconfig
fails with an exception traceback instead of passing.
Pass ignore_non_zero=True, as the other git grep calls on module and
downstream trees already do. Empty output means no references, which is
already handled.
Fixes#123546
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
The QEMU adapter closes the console FIFO while its reader thread can
still be blocked in read(). On macOS this hangs pytest teardown, even
after the test itself has passed.
Stop QEMU first so that its end of the FIFO closes and the reader
returns. Only then release the handles.
Fixes: 1b7810f0cb ("scripts: twister: Support multiple ports in
pytest-twister-harness")
Signed-off-by: Chao Liu <chao.liu@processmission.com>
When MAINTAINERS.yml changes, only the maintainers of each changed area
were added as reviewers, looked up in the checked-out MAINTAINERS.yml.
Collaborators were skipped, as were people added by the PR and members
of areas that only exist in the PR's version of the file.
Add every maintainer and collaborator of each changed area, taken from
both the base and the updated MAINTAINERS.yml, so the whole area is
notified, including people being added or removed.
Tested with pytest scripts/tests/ci/test_set_assignees.py.
Assisted-by: Copilot:claude-opus-5.5
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
A test case can be declared static ZTEST(), which makes its statistics
object static too; many Bluetooth tests do so. The source scan matches
only lines that start with ZTEST, so it misses those cases: --list-tests
leaves them out, --sub-test cannot select them, and they are known only
from the runtime output. On main this concerns 369 test cases in 22 test
directories.
Accept an optional static before the macro in both test case patterns.
Tested with the twister unit tests and with --list-tests over
tests/bluetooth.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add logic to detect gaps between symbols in an object file. These gaps
correspond to data that does not have an associated symbol (often RODATA
like strings). Map these gaps to custom nodes in the rom or ram report,
which show up under the (no paths) node with names like
"gap in symbols at 0x<addr>"
This can help users determine what data is in these hidden ranges if
they then dump their binary at the provided offsets.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@analog.com>
Support dry_run capability in the rfp runner and pass the
--dry-run flag to the runner instance. With --dry-run, the partition
(--rpd-file) and flash rfp-cli commands are printed instead of being
executed, and the check for an installed rfp-cli is skipped so the
commands can be generated on a host without the tool.
Tested with pytest scripts/west_commands/tests/test_rfp.py.
Fixes#122157
Signed-off-by: Vinh Dao <vinh.dao.wr@renesas.com>
Add the common --tool-opt option to the rfp runner so rfp-cli options
without a dedicated runner argument, such as -osc or -auth, can be
passed through west flash. The options are added to both the
partition (--rpd-file) and the flash invocations of rfp-cli.
Tested with pytest scripts/west_commands/tests/test_rfp.py.
Fixes#122157
Signed-off-by: Vinh Dao <vinh.dao.wr@renesas.com>
The suite lives in net-tools under ttcn3/suites/mld and plays the
multicast router on the link, checking what Zephyr does as a Multicast
Listener Discovery listener against RFC 3810 and RFC 2710: the report a
join produces and its repeat, the answers to General and Multicast
Address Specific Queries, the silence for a query without Router Alert,
with the wrong hop limit or from a global source, the leave, and the
move to MLDv1 compatibility mode when an MLDv1 querier is heard.
Everything the suite looks at is what the stack does on its own, so the
application here only joins one address, keeps it for a while, leaves it,
waits and starts again for as long as it runs, and a test that wants to
see a join or a leave waits for the next one. It joins once the
link-local address is usable, so that what the suite sees is the
ordinary report and not the re-report that follows Duplicate Address
Detection. It works below IP on zethL2 like the arp and ndp suites, and
needs root for the same reason.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The suite lives in net-tools under ttcn3/suites/igmp and plays the
multicast router on the link, checking what Zephyr does as an IGMP host
against RFC 3376 and RFC 2236: the report a join produces and its
repeat, the answers to General and Group-Specific Queries, the silence
for a query without Router Alert, the leave, and the moves to IGMPv2 and
IGMPv1 compatibility mode when an older querier is heard.
Everything the suite looks at is what the stack does on its own, so the
application here only joins one group, keeps it for a while, leaves it,
waits and starts again for as long as it runs, and a test that wants to
see a join or a leave waits for the next one. It works below IP on
zethL2 like the arp and ndp suites, and needs root for the same reason.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
.checkpatch.conf passed --typedefsfile=scripts/checkpatch/typedefsfile,
which is resolved against the current directory. When checkpatch.pl runs
from another directory, such as a downstream repository using
$ZEPHYR_BASE/scripts/checkpatch.pl directly or through
check_compliance.py, the file is not found and types such as FILE or
NRF_GPIO_Type produce "need consistent spacing around '*'" errors.
Default $typedefsfile to the file next to the script, as is done for
spelling.txt, and drop the option from .checkpatch.conf. Passing
--typedefsfile still overrides the default. Add a regression test that
runs checkpatch outside the Zephyr tree.
Fixes#121910
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
Added support to display driver priority and sub-priority
extracted from map file using a newly added "-p" flag.
Signed-off-by: Omar Naffaa <onaffaa@qti.qualcomm.com>
edtlib handles dma-ranges like ranges, but only ranges was exempt from
being declared in the node's binding, so a node with dma-ranges whose
binding does not declare it (e.g. does not include base.yaml) made the
whole devicetree fail to load. Exempt dma-ranges as well and add a
regression test.
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Egemen Tuncarslan <egementuncarslan@hotmail.com>
Bluetooth Classic tests on native_sim need linked virtual controllers
and one Zephyr instance per device. Without host-side support every
test carries shell scripts that allocate TCP ports, start and stop the
controllers and launch the peers, and that depend on the layout of the
twister output directory.
The "bumble" sidecar provisions this from sidecar_config, so a test
keeps its normal harness and ships no scripts. The controllers bind
kernel-chosen ports and report them to the sidecar, since a port
picked up front can be taken by a parallel worker before it is bound.
The handler watches the guest only, so the sidecar reads the Ztest
results the peers printed and reports the cases they ran, and the
peers share the scenario's timeout with the guest. On a host without
Bumble the test is built but not run.
Based on Anas Nashif's proof of concept for the pre-merge sidecar
framework (nashif/zephyr commit 099427868f7).
Tested on native_sim with Bumble 0.0.220: the acl_conn test passes
with both of its cases reported, also as three instances run in
parallel, and is only built when Bumble is missing.
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
This allows locking and unlocking uncontended mutexes without
syscalls. The futex stores the TID of the owner. The LSB should
be free, since TIDs are 4-byte aligned, and is used to indicate
if a thread is waiting.
This does not implement priority inheritance (PI), which requires
a different kind of futex.
Update futex test to use k_mutex as non-futex, since sys_mutex
now contains a futex.
Add separate test for futex-based sys_mutex, which does not cover
PI and instead tests the contested path.
Signed-off-by: Christoph Busold <cbusold@qti.qualcomm.com>
Implements https://github.com/zephyrproject-rtos/zephyr/issues/118202
This PR enables sorting of nodes and properteis.
Order of Properties in Device Node
The following order of properties in device nodes is preferred:
“compatible”
“reg”
“ranges”
Standard/common properties (defined by common bindings,
e.g. without vendor-prefixes)
Vendor-specific properties
“status” (if applicable)
Child nodes, where each node is preceded with a blank line
Node are sorted by address.
If node block contains /delete-property/ this will split the node
contents into groups. and sorting is applied within each group.
If a node block contain #include directives, this will split the node
contents into groups. and sorting is applied within each group.
If node containf ifdef/ifndef conditions, no sorting is applied within
that block.
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
ESP32-P4, C5, C6, C61 and H2 name their RAM region sram0_0_seg, which
the overflow pattern did not match, so a too large image was reported
as a build error instead of an overflow skip like on the other ESP32
SoCs.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5.5
Fixes an issue which was introduced when west attach was allowed to
reset the device, as part of west flash common code, a reset
command was added which included when running west attach, prevent
this from being added if west attach is used
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The decode error message printed `path`, a leftover from the directory
walk that names an unrelated file, or is unbound if nothing was walked.
Drop it, and catch only UnicodeDecodeError, the one error the message
describes.
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Egemen Tuncarslan <egementuncarslan@hotmail.com>
Switch to fetching the FSFE reuse tool from the GitHub mirror instead of
directly from Codeberg to work around SSL issues in some contexts.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Commit bb1794bf3a introduced a mechanism
in the J-Link runner to find the location of the JLink executable on
Winodws using its registry. This patch extends that to cover
JLinkGDBServer as well, which is located in the same folder on Windows
installations of the J-Link Software and Documentation Pack.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The rtt-client option has been unused since its introduction of the west
rtt command in 73c8235881, since in fact
the runner uses sockets and telnet to interface to RTT.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Handle functions without execution count the same way as functions with an
execution count of zero.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Check for which installed Ninja and make versions and CMake arguments
the job server becomes a named pipe, that such a job server keeps one
token per job across a claimed job and advertises the pipe in MAKEFLAGS
without passing file descriptors, and that it falls back to file
descriptors or cleans up when the pipe cannot be used or created.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Ninja 1.13 became a GNU make job server client, but on POSIX it accepts
the job server only as a named pipe. Twister hands out a pair of file
descriptors, so Ninja warns "Ignoring jobserver: Pipe-based protocol is
not supported!" and every build twister runs in parallel starts its own
full set of jobs: a load average of 150 and 11 GB of anonymous memory
for tests/bluetooth on native_sim on a 24-thread machine.
Create the job server as a named pipe when the build tool takes that
form (Ninja from 1.13, GNU make from 4.4) and no make on PATH is older
than GNU make 4.4: such a make stops with an error on a named pipe, and
native builds run make below Ninja. Otherwise, and when extra CMake
arguments select the tools, the file descriptors are passed as before.
Tested with Ninja 1.13.2 and GNU make 4.4.1: without ccache the run
above takes 425 to 438 s instead of 477 s and peaks at 4.4 GB.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
_get_info_from_build_failure() reports which region overflowed by reading
the line before the one carrying "error: ld returned":
if "error: ld returned" in line and "overflowed by" in lines[i - 1]:
At i == 0 that is lines[-1], the last line of the log. That line does not
even come from the build: JsonReport.create() appends the handler's
stderr to the build log before writing it to twister.json, which is what
this tool reads. When it happens to mention an overflow, the function
returns straight away with no region and no build step, hiding the real
overflow further down the log.
Read the previous line only when there is one, as commit 30beaec88f
("twister: reports: don't look past the start of the build log") did for
the same expression in JsonReport._parse_build_failure(); that commit
left this tool for a change of its own.
Add the first unit tests for the tool, covering the region and
build-step cases and the first-line one.
I ran the new cases against the parser directly rather than under pytest,
and did not run the tool on a real twister.json.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Leo Camus <leo.camus23@gmail.com>
Add tests for convert_from_uf2(), which had none, including a gap
between blocks, and list the file under Binary Descriptors.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Egemen Tuncarslan <egementuncarslan@hotmail.com>
Reading a UF2 whose blocks are not adjacent, such as two images built at
different base addresses and concatenated, fails with:
TypeError: sequence item 1: expected a bytes-like object, int found
Append the padding instead of extending the list with it, as upstream
microsoft/uf2 9332c30e did in uf2conv.py.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Egemen Tuncarslan <egementuncarslan@hotmail.com>
The twister Test harness attributes every Ztest suite/case marker it
parses to the current run. When a device restarts mid-run -- because it
reboots on its own, or because console output was captured from a
previously-programmed image while the board was still being flashed (the
default flash_before=False opens the serial port before flashing) -- the
markers seen before the restart are left pending. They never reach a
terminal status, so they surface as phantom 'started' cases and produce
spurious 'already STARTED' warnings once the real run re-emits the same
markers.
Discard that stale state when a restart is detected, keyed on two signals
that Ztest emits itself rather than on any application artifact:
- A start marker for a suite or case that is already running. Ztest emits
these itself, so whenever there is stale state to discard the evidence
of the restart is already present, with no dependency on any Kconfig.
This replaces the 'already STARTED' warnings the harness logged for
these restarts (729 across an 1841-log device-run replay corpus) with a
correct recovery.
- The "RunID started:" marker that TC_PRINT_RUNID_START prints at the
start of every run. A second one seen while markers are still pending
proves the image restarted, so it catches a restart that never re-emits
a marker that is still pending. It is emitted on every boot when a run
id is set, and nothing is printed otherwise.
A suite that ends before starting again is a legitimate repeat and is
left alone, as is any suite declaring expect_reboot.
An earlier revision used the Zephyr boot banner for the second signal.
The banner is an application artifact and is optional; the RunID marker
is part of the test output and does not depend on CONFIG_BOOT_BANNER.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
Updates callers of rtio_sqe_cancel to use the newer opaque handle
version which takes into account the generational allocation of SQEs.
The validation of cancel is now safe in that each SQE being cancelled
must belong to the pool in struct rtio the caller has access to and
knows about. It must also be the correct generation of the SQE so that
recycled or freed SQEs are not incorrectly dereferenced with undefined
behavior.
Adds a coccinelle semantic patch to update callers both in and outside
the tree.
A migration guide was updated to include information about the API
change and the usage of the spatch to help out of tree applications
update to the new call semantics. The spatch likely won't fix all
callers but could save some time.
Assisted-by: claude:claude-opus-5 coccinelle
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
Move several members of the struct out to the containing struct
(iodev_sqe) such that the internal rtio_sqe can be viewed as const data.
In making the containing struct const a few usages of this needed
updating to access the receive buffer through the helper
(rtio_sqe_rx_buf) rather than directly through struct members.
Assisted-by: claude:claude-opus-5 coccinelle
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
Apply the BoardYml vendor prefix check to shield.yml files too, so a
shield with an unknown vendor is caught before it reaches the board
catalog.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5.5
Unit cases for the identity the walker derives for Zephyr: which of a
release tag and the VERSION file names the version, how a pre-release
qualifier maps onto the CPE 'update' field, and what the purl is pinned
to for a fork, an unconfirmed revision, or a checkout recording no
remote. None of those states is reachable from the application test,
which only ever sees the tree it runs in.
That test keeps what a build can show: both Zephyr packages report this
tree's version and carry the matching CPE.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The CPE was only emitted when an exact vX.Y.Z tag pointed at the built
revision, leaving zephyr-sources and zephyr-deps with no version and no
CPE on every other build, release candidates included. Fall back to the
VERSION file and map EXTRAVERSION onto the CPE update field, so an rc is
recorded as cpe:2.3⭕zephyrproject:zephyr:4.4.0:rc3:*:*:*:*:*:*.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
When a file is listed in .clang-format-ignore, clang-format-diff will
report a full-file removal. Ignore those patches so it does not suggest
removing ignored file.
Signed-off-by: Szymon Antkowiak <szymon.antkowiak@nordicsemi.no>
The commit f87cfbd69d moved the list of
allowed undefined Kconfig symbols away from the corresponding text which
describes that the list is solely intended for false positive Kconfig
symbols, and not for symbols failing because they are not defined in
Zephyr tree.
Add a comment in undef_kconfig_allowlist.txt to clarify the purpose of
the file.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The entire purpose of resolve_port_by_chip() is to scan serial ports.
So when pyserial cannot be imported, that function becomes entirely
useless. When it's called anyway then it should at the very least
display an error (I think it should not even have caught the
exception but it seems too late for that)
Fixes initial commit 806a6ff3fa.
Signed-off-by: Marc Herbert <marc.herbert@gmail.com>
This commit supersedes f008ab3:
A blob is now downloaded to a temporary .part file and only moved to the
final path once the sha256 checksum matches. A failed or corrupted
download from one URL falls through to the next URL instead of
poisoning the cache.
download_blob() now guarantees that the target path holds a valid blob
or raises ZephyrBlobException.
Signed-off-by: Thorsten Klein <thorsten.klein.git@gmail.com>
Exercise the file2hex CLI with offsets, zero length, partial and exact
chunk boundaries, empty files, EOF and the unlimited default. Check both
output formats and gzip round trips. Validate list syntax to catch empty
chunks that would otherwise produce lone commas.
All 80 cases pass with the fix; 12 fail without it. The existing Scripts
tests workflow runs this test alongside the other build script tests.
Assisted-by: Codex:GPT-6
Signed-off-by: Jonghyun An <markajh@gmail.com>
The chunk reader keeps emitting data after the requested length is
consumed. A 3328-byte input with --offset=11 --length=1 produces four
bytes. Exact chunk boundaries also produce empty chunks in list output.
Limit each read to the remaining byte count and stop at zero or EOF.
Preserve -1 as the unlimited default. Verify the generated include size
through the CMake helper and run the Scripts tests and gen_inc_file suite.
Assisted-by: Codex:GPT-6
Signed-off-by: Jonghyun An <markajh@gmail.com>
The Script/Pytest/Bsim/Ctest harnesses read the spawned process output
in _output_reader() and decode it as strict UTF-8. A single invalid
byte, which is common on a hardware serial console, raises
UnicodeDecodeError. That kills the reader thread and stops capturing
the rest of the process output for the run.
Decode with errors="replace" so a stray byte no longer aborts output
capture.
Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
When a testsuite uses required_devices/required_applications, twister
locates the companion application's build directory with a regular
expression built from forward slashes ("{platform}/.*/{application}").
On Windows the build_dir is produced with os.path.join(), so it uses
backslashes and the pattern never matches. twister then reports
"Could not find a build dir for required application" even though the
directory exists. The glob that locates a pre-built required
application makes the same forward-slash assumption.
Normalize os.sep to "/" before matching so the lookup works on both
POSIX and Windows.
Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>