Add support for J-Link over IP and J-Link remote server.
If the "--dev-id" is a valid ip, the transport over ip is selected.
Otherwise usb is selected.
Signed-off-by: Michael Arnold <marnold@baumer.com>
The current zephyr.spdx does not contain the modules included in the build.
This commit split the zephyr-sources package into multiple packages, one
for each modules found by zephyr_module.py.
Signed-off-by: Thomas Gagneret <tgagneret@witekio.com>
Generated outputs can be difficult to read, preserving comments helps a
lot and they often provide good `git grep` search keywords.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero-functional change.
Also move it to a separate line so it's more convenient to temporarily
comment it out.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
CMake-based build systems like Zephyr's use separate build directories;
one for each build configuration. Even Zephyr's multi-build system
"sysbuild" (which is not relevant here) uses separate subdirectories.
So there is only one pre-processed, .toml file generated by build
directory and no need to vary its filename based on the platform name or
any other configuration parameter. It can and should keep the same
filename across build directories as zephyr.elf and all other build
artefacts do.
Moreover, when building a collection of configurations (as for instance
`sof/scripts/xtensa-build-zephyr.py` does), keeping all build
directories consistent with each other simplifies installation,
checksumming and any other post-processing.
"Fixes" recent commit 15336045af ("west: sign.py: generate platf.toml
from platf.toml.h with cc -E")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Twister DeviceHandler now checks `--enable-coverage` command line argument
instead of `--coverage` when it deals with device output.
This resolves potential problem when only `--enable-coverage` argument
is given and the coverage report is not needed. In this case the test image
which is built for code coverage works slower also producing additional
console output, so the additional DeviceHandler timeout still have to be
applied and the output with coverage data correctly processed by Harness.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Added a unit test for the platform.py module.
It covers 99% of the code. The 1% is unreachable.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
lcov 2.0 added support for processing coverage data in parallel, which
provides a large speedup when processing many files, at the cost of some
additional overhead. When running the Chrome EC tests with coverage,
parallel reporting on a 36C72T machine reduces the time spent generating
coverage reports by 40 minutes (from approximately 1 hour to 20 minutes
total runtime), at the cost of about 3x greater CPU time overall
(assumed to be overhead for parallel processing, likely from spawning
much larger numbers of subprocesses).
The level of lcov parallelism is taken from the --jobs option passed to
twister, allowing lcov to choose if unspecified.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
This moves handling of changed lcov arguments in lcov 2.0 into helper
functions, significantly simplifying Lcov._generate() to reduce the
visual noise of extra arguments that are required but unimportant to the
task at hand.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Make sure we set the gcov tool in a consistent way and avoid issues
where path is set as Path instead of a string.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
BinaryHandler.hanlde() method was trying to call GCOV and fails
silently because of incorrect call parameters. Moreover, even
being fixed, this call is not needed here as it attempts to
find and process .gcno and .gcna files (using wrong paths)
to create .gcov coverage text reports.
Currently the CoverageTool class does all data processing
and report generation using GCOVR or LCOV tools instead of
direct calls to GCOV.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Verify we have the coverage tool we want to use, otherwise we will end
up with many warnings and errors during coverage data collection.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Additional checks for Twister command line options `--coverage-tool`
and `--coverage-formats`.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Twister now uses GCOVR by default as the more reliable code
coverage reporting tool instead of LCOV.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Add two new keys: tags, tests.
tags for aligning with what we use in tests and samples and tests to
associate areas and components with tests.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Documentation pages around Kconfig have moved around on a couple of
occasions in the past [1] [2] and current redirects were dysfonctional
(leading /) and incomplete, while an entire set of redirects was also
missing. This notably fixes the "browse latest development version of
this page" link on
https://docs.zephyrproject.org/2.7.5/guides/build/kconfig/tips.html or a
link to the "Kconfig tips" page as found in Kconfiglib's current README
(https://pypi.org/project/kconfiglib/)
[1] commit 5342bc64dd [2] commit
5c88418428Fixes#66701
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
When scanning ports the manufacture field is not always
filled. It must be checked before using.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
The HEAP_MEM_POOL_ADD_SIZE_ is used as a prefix for matching specific
Kconfig option names, i.e. it's not a real option in itself.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In some cases genhtml incorrectly built reports from LCOV
coverage data using full path for some of the source files
and relative paths for other files.
This fix adds `--prefix` parameter to shorten paths explicitly
relative to the ZEPHYR_BASE directory.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This gives us the flexibility to exclude certain platforms'
simulator that's known to fail from running in Twister, but
allows real hardware to be tested.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
NXP boards with CMSID-DAP are not detected by twister
--generate-hardware-map, because serial device name 'mbed' is compared
with upper case 'MBED' in a list of supported manufacturers.
Fix it by making the comparison case-insensitive.
Tested using mimxrt1020_evk.
Fixes#63765
Signed-off-by: Michal Smola <michal.smola@nxp.com>
Rename the bitmask variables from `*_LVL_INTERRUPTS` to
`INTERRUPT_LVL_BITMASK[]` array to be consistent with
`INTERRUPT_BITS`, making it easier to loop over the bitmasks.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
The calculation of `THIRD_LVL_INTERRUPTS` bitmask in the
`update_masks()` function is wrong, the number of bits to shift
should be the sum of the first two levels.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Allow using the C pre-processor to generate a
`rimage/config/platform.toml` file from a "source"
`rimage/config/platform.toml.h` file.
This is optional and fully backwards compatible.
To use, do not use `-c` and point west sign at a configuration directory
instead or let it use the default `rimage/config/` directory and change
the files there.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
rimage is very verbose by default and has no -q(uiet) option, so saving
one line out of more than 100 lines is pointless.
RimageSigner.sign() was already very complex and suffering from
combinatorial explosion of parameters. With .toml
pre-processing (#65411) it's getting worse, so we really need all build
logs to show the complete rimage command.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In the following command, the first argument `for_rimage` is passed to
`rimage` whereas `--for west` goes to west.
```
west sign for_rimage --for west
```
This is somehow valid but we really don't want anyone to do that.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero functional change, preparation for the .toml modularization.
RimageSigner.sign() is also way too long and too complex and this helps.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
`west sign` has been invoked by `west build` (through CMake) since
commit fad2da39aa, almost one year ago. During that time, this new
workflow has been refined and successfully used by at least two vendors,
multiple CIs across both SOF and Zephyr and many developers.
At the time, the ability to sign from `west flash` was preserved for
backwards compatibility. This means rimage parameters can come from many
different places at once and that rimage can be invoked twice during a
single `west flash` invocation!
Now that Zephyr 3.5 has been released, we need to reduce the number of
rimage use cases and the corresponding validation complexity and
maintenance workload to simplify and accelerate new features like
splitting rimage configuration files (#65411)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This removes escape from generate XML_CATALOG_EACH string, because
the string between CDATA tag need to be treated as normal text.
Signed-off-by: Fang Huang <fang.huang@intel.com>
Fixes#65477
Platform key checking seemed to be erroneous;
now the variable names, comments and code seem in line with each other.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Support lcov > 2.0 tool which has strict error checking and some new
configuration options deprecating syntax used in 1.4 versions.
Fixes#62202
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Improve documentation about pytest integration with Twister. Add
examples of usage, improve description of available options and
introduce automatic doc generation of two plugin classes (DeviceAdapter
and Shell) basing on their docstrings from source code.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Introduce Kconfig option in zephyr build system that reflects the TF-M
cmake config variable with the same default value for dummy provisioning
and have it satisfy the IAK present requirement.
This configuration is not suitable for production, and by having this
in zephyr configuration we can have this as part of the hardened
configuration check.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
as in windows platfrom the format by default is not utf-8,
and we will see below error
Traceback (most recent call last):
File "...zephyr\scripts\twister", line 211, in <module>
ret = main(options)
^^^^^^^^^^^^^
File "...scripts/pylib/twister\twisterlib\twister_main.py",
tplan.load()
File "...scripts/pylib/twister\twisterlib\testplan.py",
self.load_from_file(last_run, filter_platform=connected_list)
File "...scripts/pylib/twister\twisterlib\testplan.py",
instance.create_overlay(platform, self.options.enable_asan,
self.options.enable_ubsan, self.options.enable_coverage,
self.options.coverage_platform)
File "...scripts/pylib/twister\twisterlib\testinstance.py"
f.write(content)
UnicodeEncodeError: 'gbk' codec can't encode character '\xf8'
in position 64: illegal multibyte sequence
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
It's not good to see struct_tags.json change from one build to the next
when nothing changes.
Python's sets are not deterministic, see long story for older commit
f896fc2306 ("scripts: gen_handles: Sort the device handles")
Simply convert multiple_directories to a sorted list before using it.
Fixes commit 80e78208e6 ("kernel: syscalls: no need to include all
syscalls in binary")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The Console Harness is able to parse its log with patterns to compose
extracted fields into records in 'recording.csv' file in the test's build
directory. This feature allows to extract custom test results like
performance counters.
With this change the extracted records are also written into 'twister.json'
as a part of each test suite object. This makes easier to store
all the data collected by the test for its further processing.
Other improvements:
- compile parsing pattern only once instead of at each input line;
- quote fields in '.csv' to avoid unexpected field separators;
- make 'regex' a required schema field of 'harness_config';
- Twister documentation update.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This changes the logic in __init__() so that if a path to
MAINTAINERS.yml is passed in, it uses the passed-in value
instead of blindly running git to find the top level of
Zephyr tree.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Change the keep-sorted check to handle blocks of code uniformly
indented.
Suggested-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
A race condition was possible at QEMUHandler which didn't wait for
its harness to complete causing false negatives and test suite
retries, for example when the console harness has got rather
long output from a test application to check for patterns.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Python's sets are not deterministic.
`devices` were already sorted but `dev_supports` is still a
non-deterministic set. Sort dev_supports to make the graph output
deterministic.
Fixes commit 29942475c5 ("scripts: gen_handles: output dependency graph")
It is quite ironic that this initial and non-deterministic graph commit
was concurrent with and slightly delayed other commit
f896fc2306 ("scripts: gen_handles: Sort the device handles") which
fixed another, similar non-determinism issue in the same area. A true
"whack-a-mole"!
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This allows sorting objects consistently without having to specific a
key.
No functional change yet.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Using --platform-reports will also generate json reports
with results from a single platform. Needed for on-target
results publishing process.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
As native_sim is replacing native_posix overall and
becoming the default test platform.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
One can not even replace sucessfully pytest basic sample `pytest-args`
with command line "--pytest-args", as all it does is to append a single
string to current list of commands, making it impossible to send several
arguments.
This patch fixes that by allowing several instances of `--pytest-args`
to compose the whole list of arguments to be passed to pytest.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
If a platform is fitlered, do not add it to keyed test map, otherwise we
will end up skipping all platforms from the same class without any
coverage.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add `possible` to match-leak-kinds to prevent false positives caused by
POSIX soc no cpu cleanup.
The leak can be reproduced by adding CONFIG_NETWORKING=y to
tests/lib/cpp/libcxx/prj.conf and run twister:
twister -p native_sim -s tests/lib/cpp/libcxx/cpp.libcxx.host
--enable-valgrind
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Useful option during development and when applying smaller change to the
code and verifying changes using tests. This works fine as long as no
dependencies or major changes are done, i.e. when editing few files and
in a subsystem. Use with caution and use on your own risk :-)
When building multiple tests, this provide significant boost, up to 300%
faster than when rebuilding everything from scratch or when re-running
cmake every single time.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Align with native_simulator's upstream main
ae241af736d06874ec02deb9aacb79918d745aba
Which includes:
* ae241af native timer_model: Allow calling into get_host_us_time
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Measure both cmake and make/ninja build times and log them in debug mode
and additionally put the result in the json report for tracking build
times.
Cleanup what build/cmake function return and remove unused keys in the
result map.
Remove some excessive logging of launched jobs or default platforms that
gets in the way when in debug mode.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add `__unused` to the `$Attribute` family along with its
`__maybe_unused`, `__always_unused` & `__used` brothers, so
that:
```c
__unused int ret;
```
is recognized as variable declaration, and doesn't raise
`LINE_SPACING` warning in CI.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Extend Twister command line with --pytest-args. This parameter
is passed to pytest subprocess. It allows to select a specific
testcase from a test suite.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Align with native_simulator's upstream main
7d652dbfb313260cf07d595ccf26638f2b3c2959
Which includes:
* 7d652db Provide macros for noreturn and unreachable & annotate
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In the docs replace references to native_posix with native_sim
Switch the default test platform to native_sim from native_posix
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Sync the spelling.txt file with a recent version of the one found in
Linux kernel.
List sorting was preserved (however inconsistent it might be) to
simplify future syncs.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Somehow this is seems to be a very common typo. Adding it to spelling.txt
to catch it as part of compliance check.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
On MacOS, ps utils raises a `NoSuchProcess` error rather than a
`ProcessLookupError` when a pid no longer exists.
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
The sorted check code crashes on binary files. Add a check on file type
and only process text ones.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Implement a workaround for Console harness to compose TestCase
identifier correctly when a Ztest suite with a single testcase
uses this harness type. Normally, a Ztest suite should use the
Ztest Twister harness.
Without this workaround each Ztest TestCase result on Console is
duplicated (and written into twister.json) with its 'identifier'
attribute set to TestSuite id only, no TestCase suffix added;
the resulting entry with the full TestCase id is also stored,
but its values are empty with defaults.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
If Console Harness 'harness_config' properties have no 'regex'
patterns or no correct 'type' set, then ConfigurationError exception
is raised, handled, and the test instance error is accounted
in the summary results.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Fix the Twister Console harness unordered pattern matching
to treat the ztest as failed when not all of the
expected patterns were found in the console output, but the ztest
application itself reports 'PROJECT EXECUTION SUCCESSFUL'.
Unify debug logging on pattern match for ordered and unordered patterns.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
* Replace native_posix references with native_sim
in arguments help messages
* For the seed parameter, correct platform check to accept
native_sim
* Use native_sim in twister tests
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The Kconfig check fails when running the script locally for undefined
symbols if the checkout does not include optional modules (the default
behavior). Add these symbol to the Kconfig undef list.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Create copys of the common configuration values when constructing test
scenarios, to avoid mutating the common value with test specific
appends.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
NXP released the linkserver update 1.3.15, which corrects an issue
with logging that by default went out to stderr when flashing.
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
when load test plan it is possible the plan is built in another os
so the case key would be
'samples/hello_world/samples.baseic.hello_world'
but the testsuite is scaned in current os may in window
and the key is like
'samples\\hello_world\\samples.baseic.hello_world'
so update the uniq path with only backslash in path
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
This allows defining a list within two marker (zephyr-keep-sorted-start
and zephyr-keep-sorted-stop), and have the CI validate that the block is
kept sorted every time stuff gets added to it.
This is mainly for Kconfig and CMake include lists so that there's no
ambiguity on where to add new stuff.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Some platforms prefix extra logging information before the standard
[] blocks so I've added `.\*` to the regex. Also, removed the static
values so they're only referenced using 'self.' and stopped parsing
lines after the FINISHED_PATTERN is matched since some versions of
gTest also print out a test summary after and it's not useful for
the processing.
Signed-off-by: Yuval Peress <peress@google.com>
1. remove the line number check in test vector
2. log_info is not a static method anymore, change test
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
When pytest scenario fails, then 'handler.log' is printed.
Changed to print 'twister_harness.log' that is a log from
pytest execution. That file tells much more when test fails.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Apply a workaround for an issue introduced with bc8b7dd
for code coverage collection at qemu_x86 when gcov data
was broken because of optimized out memcpy() in write_u64()
static inline function, so gcovr parser fails with
"gcovr.gcov_parser.NegativeHits: Got negative hit value
in gcov line 'branch 1 taken -1'".
Add gcovr command line option to ignore such errors (since v.6.0):
"--gcov-ignore-parse-errors=negative_hits.warn_once_per_file"
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The current error messages are a bit cryptic, rework them to make them
more meaningful:
- add an extra message on the first error to explain what the errors
refer to.
- rework the error message to be more explicit.
- rework the priority string print to use a LEVEL+offset format to
somehow highlight that the number is the offset from the level, not
the actual priority.
- print the init function name in addition to the devicetree path.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Since bb590b5b6e introduced ordinals in the priority sequence, the "same
priority" case cannot happen anymore, furthermore the priority value in
the script is now the position of the function in the init sequence, so
if two devices have the same priority there's something real bad going
on.
Drop all the "same priority" handling code and tests, convert the case
into ane exception instead. Drop the init stubs as well from the test,
they are not required anymore.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The existing driver and sample:
- drivers/bluetooth/hci/rpmsg
- samples/bluetooth/hci_rpmsg
are no longer correctly named, since they now use the IPC subsystem to
send and receive data. The IPC subsystem can use RPMsg as a transport,
but that is one of several selectable backends.
I initially wanted to deprecated both the BT_RPMSG Kconfig option as
well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However,
this proved to be undoable in the case of the Kconfig option. This is
because it's a choice option, and those have special behavior. In
particular, the only practical way to deprecate would've been to keep
the old Kconfig option outside the choice (much like it's done in this
commit) but then also add a 'depends on !BT_RPMSG' on each of the
remaining choice symbols *except* on the new BT_HCI_IPC one. This, however,
only works correctly for .conf files. If a board instead sets the
default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig
tree parsing would fail, because it'd try to set it to a value
(BT_RPMSG) that is no longer part of the choice.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add a guidelines rst converter script
to convert the rst document written coding guidelines
into another format.
First supported format is the format for cppcheck
Signed-off-by: Simon Hein <Shein@baumer.com>
Use mock.patch instead of monkeypatch for os.name in unittests
to fix error when executing tests under VSCode
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
The multi-level encoding of the interrupt number currently
happens in the `gen_defines.py`, which is called in the
`dts.cmake` module after `kconfig.cmake`. However, the number
of bits used by each level is defined in Kconfig and this means
that `gen_defines.py` will not be able to get that information
during build.
To fix this, do the multi-level encoding in C devicetree macro
magic instead of the python script. This ticks one of a
long-standing TODO item from the `gen_defines.py`.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Commit 72f416f382 added a horizontal
scan for .yaml files when a modification was made in "common" folder.
If yamls were found in such way, the loop ended. However, the
implementation didn't address what happens if such yamls are not found.
This made the script going into an infinite loop. If yamls are not
found next to "common", the script should proceed as before, i.e. go
to the directory above an start looking there.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Errors did not have their dedicated test file.
This change adds it to the repo and
checks the only non-def statement there.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Creates a few dozen new tests that cover every runner.py method.
99% coverage (All statements save for one) is achieved.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Added pytest_dut_scope keyword under harness_config section.
New keyword is used to determine the scope of dut and shell
fixtures in pytest-twister-harness plugin.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Some tests use a "common" directory to store pieces of code which
are reused by different scenarios. In those cases, no test yaml is
found within such director nor within its parents.
If no test yaml is found in a directory, and the directory is called
common, also look in collocated directories if they have test yamls.
If so, add all those locations to the scope.
E.g. tests/bluetooth/controller/common
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
The script was not resolving all detected changes uniformly:
find_excludes() could skip or not certain patterns based on
required testing scope. The idea was to not include files
that were already handled by find_test() and find_boards() workflows.
However, only boards and tests folders could be removed but
not samples. This also led to blind spots: changes in some files
were not triggering any tests. E.g. change in a test/common, where
no corresponding yaml can be found by find_tests() which is also
ignored by find_excludes(). In the new workflow a list of resolved
files (for which find_arch(), find_tests() or find_boards()
found scope) is created. Instead of using skip in find_excludes,
files are excluded only if they were resolved.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Add support for getting strings from section which is not part
of the binary.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
If in a server multiple users are running compliance then it throws
errors as the filename "Kconfig.modules" and "Kconfig.dts" is owned by
someone else.
Fix this by creating a randomized Kconfig file and delete after use.
Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
Introduce the `configdefault` keyword as a Kconfig extension. This new
keyword allows `default` values to be applied to externally defined
symbols without needing to respecify dependencies, or weakening the
existing dependencies.
This is primarily useful in downstream repositories that wish to define
default configurations such as:
```
config MY_COMPANY_APPS
bool "Apply defaults for internal applications"
configdefault BT
default y if MY_COMPANY_APPS
configdefault MCUMGR
default y if MY_COMPANY_APPS && BT
```
Obtaining the same functionality with `config` (without weakening the
symbol dependencies) requires finding the original definition and
duplicating any `depends on` and surrounding `if` statements. This is a
non-trivial exercise that needs to be manually rechecked on each Zephyr
update.
`configdefault` simplifies this process by acting as if the `default`
statement was present at any one of the original definitions of the
symbol.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Use "call_args_list" from unittest.mock instead of "called_with" for
verifying the arguments supplied to the dfu-util west runner.
This aligns the assert with the rest of the test case and fixes the
dfu-util west runner test when running under Python 3.12.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This updates SOF modules to commit
e7cb489d430dc2181e4a5f7f953ed1eaeec6668d. This includes
a change where rimage is pulled into the tree and is no
longer a submodule. So update the rimage config path so
signing still works.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Non-SOF build does not have extended manifest data for
rimage to process, which might result in rimage error.
So do not do extended manifest during signing when not
doing SOF builds.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Now that child nodes are handled by edtlib there's no need to parse
child nodes in check_init_priorities anymore.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The current EDT graph logic only use properties directly under a
specific node to add dependencies. For nodes properties in
child-bindings, this means that the child phandles are only linked by
the child node itself, which does have an ordinal but no corresponding
"sturct device" in the code, causing those dependencies to be silently
ignored by gen_handles.py.
Fix that by adding the recursive logic to visit child bindings when
present, which causes all child node property handles to be linked to
the parent node.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The NXP S32 Debug Probe is a JTAG-based probe that enables debugging on
NXP S32 devices. This probe is designed to work in conjunction with NXP
S32 Design Studio and this runner offers a wrapper to launch a debug
session from cli.
`flash` command is not implemented at the moment because presently there
are no zephyr boards that can make use of it and test it.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Allow the runners to pass extra keywords arguments to both the server
and client subprocesses calls, as can be useful for instance to set
a specific execution environment.
ZephyrBinaryRunner.check_call() already supports passing kwargs to
the inner subprocess call but this is currently not possible when
starting server/client processes. So pass through the kwargs to each of
the client/server subprocess calls.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Allow the runners to override the default search path, e.g. when
provided through command line. The default is to search for the program
binary on the system PATH.
This is useful when the runner allows to optionally override the search
path of the tool, in the case there are multiple versions or
installations, and not necessarily the tools path are present in the
system PATH environment variable. For example:
`tool = self.require(tool_name, path=args.tool_path_override)`
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Do not break processing when incorrect coverage data are received.
Instead, report failures but still process valid data.
Include coverage processing status within twister retrun code.
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
When coverage is enabled, gather console logs longer
to receive gcov data which are send after test output.
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
Define the ZEPHYR_{MODULE_NAM}_MODULE option for all available modules.
Right now only modules defined as 'kconfig-ext' has this symbol defined
which may cause problem if the build wants to check if a module not
using this options is available.
This allow us to do something like:
comment "mbedTLS module not available."
depends on !ZEPHYR_MBEDTLS_MODULE
or make a feature depends on the module be present.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The arg --testsuite-root was copied from twister. When it is used
for test_plan.py it will be propagated to twister calls. This allows
to make alternative test locations (e.g. from another repo) to work
with test_plan.py
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Add --alt-tag arg for test_plan.py script. User can use it and point
to an alternative file with tag-directories relations. If so, such
file will be used instead of the default one.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Expand test_plan.py args with --ignore-path. This allows to provide an
alternative lists of patterns for the script.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
The test_plan.py script has a path to repository to be scanned for
changes hard coded to zephyr. This patch separates zephyr path from
such repository's path and adds an arg to pass repo to scan
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
An option --no-detailed-test-id was added to twister to help align
names for test outside of zephyr tree. This commit add this arg
to test_plan.py script which is then propagated to twister.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Align with native_simulator's upstream main
d32b2504ad2b6d6d541bc71a0f9b16ab7b6a3831
Which includes:
* d32b250 Minor format fix
* 7b4f35b native HW counter: Provide new API to reset and control
* 4f815cb INT CNTLR: Bugfix for more than 32 interrupts
* 1d36254 Provide new 64 version of nsi_find_lsb_set
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Cleanup of script and change how we assign PR in general:
Make sure that when multiple areas are changed, including platform or
driver changes, we set assignee of the general areas and not the
platform maintainers. For example, if I change 100 SoC files and touch
the kernel file, the assignee is set to the kernel maintainer.
First, we should as much possible try and split such changes and not
have common area changes with platform changes at the same time. Second,
it is important that such changes which affect everyone are reviewed and
approved by the maintainer of the general areas rather than leave them
to the platform maintainer.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit removes the needs or generating isrList.bin temporary file.
Now gen_isr_tables.py script access the required section directly in
elf file, that was accessed by the script anyway.
It simplifies the building removing one step.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
The current description of the relationship between the tests filter
and the arch/platform allow/exclude was actually incorrect.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Very verbose log message without too much context that should be a debug
message rather than a info().
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
An urforseen error was introduce with #62713. When "--device-testing"
or "--filter runnable" is used in CLI, twister will skip tests which
cannot be executed (not just built) on a given platform. If a given
platform is among integration platforms it will cause an error.
However, it shouldn't be the case. Such skip is intentional and
shouldn't be an error. Fixed by assigning an existing Filter.CMD_LINE,
which is exempted from being turned to error.
fixes: #63844
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Reset TestInstance status when ProjectBuilder.run() is called
to run the test after its successful build, so the build status
will not propagate as the run status if the run fails.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Fix the Twister Console harness ordered 'multi_line' and 'one_line'
pattern matching to treat the ztest as failed when not all of the
expected patterns were found in the console output, but the ztest
application itself reports 'PROJECT EXECUTION SUCCESSFUL'.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
When we have an empty Devicetree, ie,
```
/dts-v1/;
/ {
};
```
The node's dep_ordinal is never initialized because the node graph is
empty. This ends up with invalid ordinal tokens (-1) in
devicetree_generated.h which in turn produce some cryptic compiler
errors, see e.g.
```
error: pasting "dts_ord_" and "-" does not give a valid preprocessing
token
95 | #define Z_DEVICE_DT_DEV_ID(node_id) _CONCAT(dts_ord_,
DT_DEP_ORD(node_id))
...
include/zephyr/devicetree.h:2498:41:
note: in expansion of macro 'DT_FOREACH_OKAY_HELPER'
2498 | #define DT_FOREACH_STATUS_OKAY_NODE(fn)
DT_FOREACH_OKAY_HELPER(fn)
|
^~~~~~~~~~~~~~~~~~~~~~
include/zephyr/device.h:1022:1:
note: in expansion of macro 'DT_FOREACH_STATUS_OKAY_NODE'
1022 |
DT_FOREACH_STATUS_OKAY_NODE(Z_MAYBE_DEVICE_DECLARE_INTERNAL)
```
(devicetree_generated.h)
```
...
#define DT_N_ORD -1
#define DT_N_ORD_STR_SORTABLE 000-1
...
```
This patch makes sure root node is always inserted (without any target)
so that it gets initialized later.
Discovered as part of
https://github.com/zephyrproject-rtos/zephyr/pull/63696
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Make `kconfig.py` not crash when any one of these settings is undefined:
* DEPRECATED
* EXPERIMENTAL
* WARN_DEPRECATED
* WARN_EXPERIMENTAL
While these will continue to exist in Zephyr, they shouldn't be strictly
required for the script to work. One situation in which they could go
missing is when a user creates an application-specific Kconfig root, but
forgets to source "Kconfig.zephyr" inside it - not that this is expected
to work anyway, but it could at least raise a more intelligible error.
Note that when WARN_DEPRECATED is undefined, selecting DEPRECATED will
always produce warnings. Same with WARN_EXPERIMENTAL and EXPERIMENTAL.
This matches the fact that the WARN_* symbols normally have `default y`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
There might be situations where people are running the coreutils version
of stty on macOS, hence the need for being smarter at detecting when
that might be the case
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The runnable output from the build system is the
exe file. In native_posix the elf happend to also be
runnable, but this is not the case in general,
and not for native_sim or the nrf5*bsim boards.
So lets use the exe instead.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add the exe fle to the runnerconfiguration class,
so we can use it from runners which will need it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
PR #63195 has managed to change code under test without
triggering those tests.
This change should remedy that by creating a new workflow,
based on twister_tests.yaml, that runs tests in
scripts/tests/build_helpers if build_helpers are modified.
Such a workflow should be easily extendable if we ever have more
non-Twister things to test in scripts/pylib.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
PR #63195 has changed how Domains work without
triggering necessary tests, thus breaking them.
This commit fixes the domains tests.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
If flash_order were to be missing from the YAML, the Domains init
would crash instead of substituting an empty list.
This commit fixes that.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Fix the correct path to net-tools directory.
Also default to Bash instead of /bin/sh as we use
Bash syntax.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Currently, the following macros will only work for 0 - 255:
- `IS_EQ`
- `UTIL_X2`
- `UTIL_INC`
- `UTIL_DEC`
- `LISTIFY`
This patch increases their limit to 4095.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
By requiring a full-on YAML fragment, the Domains class can rely on
pykwalify to do the heavy lifting with validating types and structure.
Remove support for loading domains from a dictionary, so that we don't
ever have to replicate the same checks on the input, and we can instead
have a single entry point.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Do extra checks to reject inconsistent `domains.yaml` contents early:
default: app
build_dir: /path/to/build
domains:
- name: image_1
build_dir: /path/to/build/image_1
- name: image_2
build_dir: /path/to/build/image_2
flash_order:
- image_1
- image_2
- unknown
This example lists "image_1" and "image_2" as known domains, but an
entry for the default "app" is missing, which should never be allowed.
A valid `domains.yaml` file shall also not contain extra domains under
`flash_order`, such as "unknown", which doesn't appear under `domains`.
Either of these cases can now be caught while initializing an instance
of the Domains class.
It follows that a valid `domains.yaml` file must always contain a list
of domains with at least one entry - the default image. Since `default`
is a required key in the YAML schema, `domains` should be required too.
Thus, empty lists will be rejected by pykwalify, so the questionable
warning for "no domains defined; this probably won't work" can be axed.
Fixes#63166
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
When using a quarantine file with more than 512 unique
entries, than time of matching quarantine increases
significantly. This is because regexp cache size is
512. Add precompiled regexp entries to the quarantine
as a fix.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
All handlers except QEMU were right-stripping console lines before
checking them. In certain cases where the regex is expecting the
whitespace, this could make the test fail on qemu when it is passing
on something else. Change QEMUHandler to us .rstrip instead of .strip()
Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
The network core needs to be recovered first due to the fact that
recovering it erases both the network and application cores' flash
memory. This means that the little flash image that is programmed during
the recover operation would be lost for the app core if we inverted the
order.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In PR #62947 a timeout variable was replaced with a method,
but this timeout was used in another place to start
pytest subprogram. This commit provides a fix.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This provides miscellaneous quality of life improvements:
- We couldn't use dataclasses when this class was originally written.
We can now, so move to dataclass to avoid having to write
__repr__().
- Add missing validation for the advertised commands
- Add missing documentation for the 'file' capability
Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
Test suites names are not being handled uniformly for tests not
in zephyr tree. Their names depend on -T arg used in twister's CLI.
The newly added options allow to select if twister should add paths
to suite names. This is needed if test plans are to be used for tests
outside of zephyr tree.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
"Path" is a path (relative to zephyr) to a directory with test suite's
definition. Such entry helps to locate a given test.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Domain module was not yet covered by explicit unit tests.
This commit adds a new test file to cover that gap.
It achieves 100% coverage at the time of creation.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
In test-only mode with a hardware map, all tests with fixtures were
skipped, even when the hardware map has appropriate fixtures defined.
TestPlan.load_from_file had the check for fixtures missing, but actually
best is that the TestInstance checks the fixtures in the hardware map.
Signed-off-by: Manoel Brunnen <manoel.brunnen@ithinx.io>
Twister allows us to control maximum execution time for each test
with timeout value in test's .yaml configuration and
platform level timeout multiplier which allows us to tweak
timeout value for specific platform.
However, sometimes we want to additionally adjust tests timeouts
when running twister. This is especially useful in case of
simulation platform as simulation time may depend on the host
speed & load, we may select different (i.e. cycle accurate but
slower one) simulation method, etc...
Let's introduce global (twister-level) timeout multiplier option.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
There is clearly an issue with current timeout value
timeout into mocked_instance as this value is used only
once before this mock happen, so this mock is actually useless
and we always use default value. Fix that.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
The experimental status of the PPP L2 is long overdue so
it can be removed as the component is working fine.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The west bindesc command currently crashes when no subcommand is
given. This is because the subcommand was not marked as required.
This commit fixes the issue.
Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Some of the runners in the tree have been adding their own,
class-specific versions of a switch to instruct the runner to reset or
not the device after flashing.
In order to better support multi-image builds that require more than one
flash operation, introduce a new --reset,--no-reset command-line
parameter that is part of the RunnerCaps so taht this functionality can
be accessed in a standardized manner.
Implementations for the new parameter are provided for the runner
classes that were already configurable in this regard.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Added the bindesc command to west, for working with binary
descriptors. Currently it supports dump, list and search
subcommands, for bin, hex, elf and uf2 file types.
Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
This adds support for using coredump with Xtensa DC233C core,
which are being used by qemu_xtensa and qemu_xtensa_mmu.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds a test for the data sharing retention feature of MCUboot
configuration to an application.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a bootloader configuration interface which allows for a
bootloader (e.g. MCUboot) to set configuration in a shared data
area which is then read by the application.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The recent support for BUILD_ONLY images was implemented by excluding
them from `domains.yaml`, in order to crudely prevent them from being
picked up by `west flash`. Arguably, this is incorrect or unexpected,
because the sysbuild documentation defines a "domain" as:
Every Zephyr CMake build system managed by sysbuild.
Another consequence is that, given a build-only `<image>`, this makes it
impossible to pass `--domain <image>` to `west flash`, `west debug`, and
ironically `west build`.
To fix that, `domains.yaml` should again represent all domains, and the
build-only ones should be indicated in another way. Enter `flash_order`:
a new top-level key in the domains YAML schema. It contains the default
sequence of images used by `west flash`, where the build-only images are
excluded, and the order is influenced by `sysbuild_add_dependencies()`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Added application based on SMP Server Sample. Application is built together
with MCUboot using sysbuild and is flashed onto device in one step.
Tests are automated with pytest - new harness of Twister.
The image for upgrade is prepared using west sign command
then is uploaded by mcumgr into device and tested.
Automated scenarios to test upgrade (image upload, test, revert, confirm),
to test downgrade prevention mechanism and to test upgrade with image,
that is signed with an invalid key.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Add support for setting reviewers as well for module PRs, in addition to
the assignees.
Note that this still only works on repositories with an assignee on
record since it does not seem to be possible to query for PRs that have
no reviewers.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Currently, when a Robot test is run, the test case status value is
reported as `None`, which causes the XML to contain information about
the test being skipped due to misconfiguration.
This commit fixes the value reported in Twister XML test result by
assigning the test result to the `status` variable of a testcase
instance after the test has finished running.
Signed-off-by: Franciszek Pindel <fpindel@internships.antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
The C standard specifies 'hh' as a length modifier indicating an integer
conversion specifier applies to a signed char or unsigned char
argument. Python doesn't do that, so replace relevant %hh with %h.
Also fix the handling of %ll so that it applies to all integer specifiers
as well.
Signed-off-by: Keith Packard <keithp@keithp.com>
Bump number of cores limit in mdb west runner.
As we are here - adjust core number in runner test closer to
the limit.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This is coming from devicetree and corrosponds to what we have in the
dts/bindings/vendor-prefixes.txt file.
This will allow for static filtering, especially with twister, i.e. no
need to build anything to know the vendor of a board
All of the vendor data was extracted automatically from the devicetree,
so some platforms might not have the right vendor or no vendor at all
right now, we need to fix some of the DTS information or do this
manually to get this 100% correct. But we are close.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a new option --vendor which allows filtering by vendors tracked in
the board/platform yaml file. The vendor string is compatible with DTS
and is what we have in dts/bindings/vendor-prefixes.txt.
Providing multiple vendors is also supported.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We don't need to have two different sets of Zephyr-specific default
values overriding one another, it's confusing.
Note this commit makes NO functional change, the effective defaults stay
the same. It does however make it easier to change defaults in the
future.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Rework check_init_priorities to use the main executable file instead of
the individual object files for discovering the devices.
This should make the script more robust in case of stale files in the
build directory, and also makes it work with LTO object files.
Additionally, keep track of the detected init calls, and add a handy
"-i" option to produce a human readable print of the initcalls in the
call sequence, which can be useful for debugging initialization problems
due to odd SYS_INIT and DEVICE interactions.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Only impacts on twister-pytest scenarios. Exec command is waiting for
the prompt message, but in some cases, e.g. after reseting the DUT, prompt
can be followed by another strings. Solution is to clear internal serial
buffer and to not request the prompt string before executing a command.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Sometimes you might need exec_command() to return an value from
running device. If the output contains shell prompts or logger
output, it is harder to capture the value.
Filter away the lines we thing belongs to the shell prompt or
normal logging output.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Skips are turned to errors on integration platforms. However, if
a user (or a CI) selects toolchain other than zephyr, unexpected
errors due to skips can appear. With this commit skips due to
toolchain incompatibilities are not treated as errors.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
If coverage is provided by a different platform not in the integration
list, it should not be reported as error.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove dead and erroneous (DUT is not a dict) if branch. Simply use the
self.options.platform list. Which is filled by either the hardware map
or the '--platform' option.
This change addresses issue #62723 and #62560.
Signed-off-by: Manoel Brunnen <manoel.brunnen@ithinx.io>
Before only with --integration such skips were changed to errors.
This hinders issues when twister is call with --all flag in CI
and new skips on integration platforms are not caught. Then those
skips cause errors in other PRs when --integration was used.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
The value of emulation_platforms is a bool corresponding to
--emulation-only CLI option. Therefore, it should be registered
as Filters.CMD_LINE. Without it, twister raises errors when an
integration platform is descoped due to this option.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Added an exception to scl.py module, to not process an empty
yaml file, because of error from pykwalify. New exception
is handled when processing quarantine files, to allow
an empty file.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
After the handler.py module has been split up more,
we can update the relevant tests.
100% coverage achieved.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Simple refactoring aiming to reduce the average method length.
Minor corrections of the handlers module, removing wholly unused
variables, etc.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Expansion of the tests related to handlers.py
Achieves over 85% coverage.
Implemented most of golowanow's suggestions.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Allow to specify a list of pytest directories, files or subtests
with pytest_root keyword in test yaml.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Align with native_simulator's upstream main
64b8be6311a61df2c63987813e8058560c8dc49c
Which includes:
* 64b8be6 Make: Give option to add extra localization parameters
* 05bc3ce Generalize code for N CPUs/MCUs
* 489069b Makefile: Generalize for N embedded images
* a4c817e runner->embedded trampolines: Improve definitions
* 8d8dd29 nsi_utils: Provide debracket macro
* 6b4956e Add optional embedded test hook definition
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a check to ensure that every module has a corresponding maintainers
file entry, ensure modules are not added with no recorded point of
contact.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Fixtures in pytest-twister-harness plugin are moved to one
file to simplify adding new fixtures in the future - no
need to add pytest_plugins entry and register asserts.
Moved also shell fixture from sample dir, because that
fixture can be reused in new tests.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This commit introduces all the necessary changes for
enabling the usage of shared interrupts.
This works by using a second interrupt table: _shared_sw_isr_table
which keeps track of all of the ISR/arg pairs sharing the same
interrupt line. Whenever a second ISR/arg pair is registered
on the same interrupt line using IRQ_CONNECT(), the entry in
_sw_isr_table will be overwriten by a
(shared_isr, _shared_sw_isr_table[irq]) pair. In turn, shared_isr()
will invoke all of the ISR/arg pairs registered on the same
interrupt line.
This feature only works statically, meaning you can only make use
of shared interrupts using IRQ_CONNECT(). Attempting to dynamically
register a ISR/arg pair will overwrite the hijacked _sw_isr_table
entry.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Update CFB font generator so it works with Pillow version 10. They
deprecated some methods, with no direct replacements, so the generated
fonts might be slightly different.
Signed-off-by: Jonathan Rico <jonathan@rico.live>
If pylib twister harness reads bytes that can't be decoded to Unicode,
it would raise an exception at a separate "serial reader" process, that
would fail without any warning.
This patch uses "errors='replace'" parameter for Python str.decode()
method, so that this doesn't happen.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
A commit breaking tests slipped past CI checks.
This commit fixes broken tests in test_testsuite.py.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Previously, only the main src/ directories was scanned for
ZTest testsuite names and tests. This allows us to place
test sources in subdirectories as well.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add support handling quotes for configuration options in extra args by
escaping them properly instead of removing the quotes altogether. For
other options in extra_args quotes are removes as usual.
Add similar support in west build command also.
Add a unit test to check this functionality.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Log the device priority on the file debug output print, this is
convenient to list out all the defined devices and their priority, even
if they don't depend on each other.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
During testing it was found that if the partition type was displayed as
msdos it could not be detected correctly, so this partition type
determination was added.
Signed-off-by: Yuchao Guo <yuchao.guo@hoorii.io>
LinkServer is NXP's tool to flash and debug on MCU's.
This patch expands support for LinkServer to MIMXRT1170.
There is one limitation with flashing and debugging the SoC's seciond
core (COrtex M4) that will be addressed with a future submission.
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
This should increase the coverage of the testsuite.py module
up to 100%.
Some tests have been commented out, as the code tested there is
incorrect. Thus the real increase is 99%.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
It is only available if CONFIG_DEVICE_DEPS=y, so the ZephyrElf class
would fail to load if it does not treat _DEVICE_STRUCT_HANDLES_OFFSET as
optional.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Before, only following way of getting test-item build was supported:
`west build -b <BOARD> -T <PATH_TO_SOURCE/TEST_NAME>`
This commit allows to also call it by:
`west build -b <BOARD> <PATH_TO_SOURCE> -T <TEST_NAME>`
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Add tests which use pytester to call pytest with pytest-twister-harness
plugin on previously defined test. This gives a possibility to test
plugin in end-to-end variant.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>