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>
According to new adapters API add new tests which verify their
correctness. Introduce some minor naming changes to describe better
their role.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Add better description of available options and add actions which
should help to prevent from passing invalid options to plugin.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Remove log.py and by this logging configuration from
pytest-harness-plugin. Instead use pytest options for setting verbosity
and format of printed logs. Thanks to this management of verbosity
level can be easier for users.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Create helper class Shell which can be used in tests which require
interaction with shell application.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Move helper.py file content to utils.py file in device directory,
where those helper functions are used.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>