Commit graph

4745 commits

Author SHA1 Message Date
Michael Hope 22f7702e27 scripts/runners: hack: use the wlink specific commands to start the board 2024-05-17 19:44:48 +02:00
Ederson de Souza 967168a536 subsys/llext: Generate syscalls stubs for EDK exclusively for userspace
A new Kconfig option which generates syscall stubs assuming that
extensions will always run on userspace, thus simplifying linking
them, as there's no need for z_impl_ stubs (used for direct syscalls),
CONFIG_LLEXT_EDK_USERSPACE_ONLY.

While defining __ZEPHYR_USER__ could have the same effect for optmised
builds, people building extensions on debug environments - thus
non-optimised - would suffer, as they'd need to somehow make the stubs
available (by either exporting the symbol or implementing dummy stubs).

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Evgeniy Paltsev 0af51b072c ARC: nSIM: west: launch cores in direct order for simulation run
We've reversed core launch order to workaround issue of
ARConnect initialization interfere with secondary cores
startup (we don't want to workaround it in runtime as it's
only possible in case of debug session).

However it bring us new issues with the simulation run:
 - mismatch arcnum (core ID) with ARConnect ID
 - mismatch arcnum (core ID) with CPU name in nSIM instruction traces

To avoid these issues let's use direct core order for simulation
runs.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-05-17 12:40:52 +02:00
Maciej Perkowski 7d3dc4e7e3 twister: Fix path to binary location for unit_testing board
PR #72100 broke execution of unit type tests. This commit fixes
it by bringing back the "old" logic for selecting a binary path
for unit type tests.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-05-16 14:27:06 +02:00
Dmitrii Golovanov 0887986b88 west: twister: Fix default options setup
Fix missing change to run Twister with default options setup.

Should be implemented together with #72399

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-16 09:21:35 +02:00
Dmitrii Golovanov 4efc035209 twister: Fix default command line dependency on --device-testing
Fix default command line options check dependency on `--device-testing`
when it is provided to run Twister and turn device command options
as mandatory.

Fixes after changes introduced with #72399.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-15 15:13:19 -04:00
Lukasz Mrugala f71a4184f3 scripts: twister: Fix Unit Tests on Windows systems
Unit tests currently are not runnable on Windows systems, failing
on two testfiles: test_jobserver.py and test_testsuite.py.

This commit removes code dependency on Windows-unavailable
elements on Windows systems via skipping the offending tests.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-05-15 17:08:06 +02:00
Dmitrii Golovanov d45dbc26f0 twister: Add Twister execution options to twister.json
Store Twister command line options in twister.json report as
`environment.options` object. It allows to keep the actual
execution context for test results analysis and history comparison.

A new command line option `--report-all-options` enables to report all
command line options applied, including these set as default values.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-15 14:56:59 +02:00
Hake Huang 248b66dfe3 twister: handler: optimize handler testsuite check
in many platforms, before  the debuger flash, the former testsuite
many already executed, so we will see some old testsuite name.
and we should not compare them directly, instead if we compare in
reversed order them we can avoid such mis-judge.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-05-15 14:56:24 +02:00
Grzegorz Chwierut 59212c198c twister: Allow to run sysbuild with native_sim
Fix issue 72083. Update path to zephyr.exe binary using
default domain from domains.yaml file.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-05-15 13:16:39 +02:00
Kamil Paszkiet 85c6ce69ca scripts: tests: Blackbox test expansion - report summary
add test for report summary switch

Signed-off-by: Kamil Paszkiet <kamilx.paszkiet@intel.com>
2024-05-15 09:29:05 +02:00
Kamil Paszkiet a411ae93b7 twister: add --report-summary switch
Added a switch that show failed/error report from the last run.
Default shows all items found. However, you can specify the number of items
(e.g. --report-summary 15).
It also works well with the --outdir switch

Signed-off-by: Kamil Paszkiet <kamilx.paszkiet@intel.com>
2024-05-15 09:29:05 +02:00
Carles Cufi ae9096fe62 scripts: compliance: handle multi-line output from pylint
Switch from plain text to JSON output in the pylint compliance check in
order to handle multi-line messages, which were so far being dropped
by the regex.

Fixes #68037.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-05-14 18:20:41 -04:00
Dmitrii Golovanov 11de74c11f twister: pytest: Enable recording for Pytest Harness
Extend Pytest Harness to support 'recording' feature to parse
test log by a regular expression and collect as records the same
way as Console Harness do.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-14 18:20:12 -04:00
Dmitrii Golovanov 1230640076 twister: Refactor 'recording' feature
Refactor Twister 'recording' feature moving it from Handler class
to TestInstance class and enable it also for other Harness child
classes other than Console.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-14 18:20:12 -04:00
Dmitrii Golovanov 2005deddb4 scripts: size_report: Fix tree build for symbol copies
Fix the memory footprint tree build for symbols with copies,
e.g. static inline functions which are local per each compilation
unit. Copies have the same path and symbol name, but different
memory blocks associated, so they have to have separate nodes.
Before the fix, these copies were merged into one node, with
summary size and memory address of one of the symbols.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov b438a74bd0 scripts: size_report: Report section name for symbols
Report section name for symbols: both at json and text reports.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov 8e6a921104 scripts: size_report: Don't set non-terminal node address
Don't set 'address' property for non-terminal nodes which are
also shown in JSON footprint reports, thus to avoid confusion
that a file or directory node has a continuous memory area allocated
at some address and with the total size of all its associated child
nodes which are likely scattered over different memory sections.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov 272731169c scripts: size_report: Optimize ELF headers reading
Read ELF headers only once for the size_report scirpt called
for 'all' memory areas, consequently it executes 30-50% faster.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov 55ebc691cd scripts: size_report: Fix pylint warning on unused import
Remove unused import to resolve pylint warning.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov 6c5eaacbb7 scripts: size_report: Fix underflow on a section end address
Fix integer underflow bug on a section end address calculation
causing incorrect address range for zero length sections and
potential mistakes on symbol to memory area match.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Arkadiusz Cholewinski 60aeb4e6bc CI: Fix coverage reporting
The fix applies to parse_testplan function.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2024-05-13 14:23:00 +02:00
Dmitrii Golovanov 4d85967e09 twister: Set default coverage platform only when needed
Set options.coverage_platform only when running coverage.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 11:39:16 +02:00
Maciej Perkowski be682e22e1 twister: allow using west-flash with 'erase'
Using `erase` with west-flash was blocked as it was
messing with sysbuild. With #69748 the issue is fixed, hence
'erase' is no longer blocked.
Remove obsolete twister test

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-05-10 20:26:02 -04:00
Andrej Butok e1cde2e8d1 west: linkserver: fix erase error
- Fixes linkserver runner "west flash --erase" error:
  ERRMSG: Exception: Device query can have at most 2 parts (3 found)
- There is no need to specify the core with
  the flash erase command line.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-05-10 18:07:18 -04:00
Dmitrii Golovanov 1da6e57342 twister: Fix platform report generation called multiple times
Fix Twister to generate platform reports (`--platform-reports`)
only once for each platform instead of repeating it multiple times
for each instance executed.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-10 14:43:58 -05:00
Jordan Yates c0813ef1f2 scripts: twisterlib: coverage: exclude LOG_* branches
Disable the branch coverage calculations on the `LOG_*` family of macros.
Branch misses are due to the implementation of `Z_LOG2` and cannot be
reasonably covered in library code. The internal paths through the
`Z_LOG2` macro are not of interest when inspecting files that happen to
use the Zephyr logging API.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-10 11:50:46 +03:00
Hake Huang ccf95e8773 twister: testplan: enable runtime quarantine
sometime we need use quarantine at runtime when --test-only
add this will help to skip problematic cases in test cycle

to reenable the quarantined case you need add
--quarantine-list quarantine.yaml --quarantine-verify

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-05-08 15:51:36 +02:00
Peter Johanson b064a2cfcc scripts: Update uf2conv.py from upstream git.
Pull in the latest uf2conv.py and newly needed uf2families.json file
to address Python warning on Python 3.12 and keep us in sync.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2024-05-08 09:31:07 -04:00
Henrik Brix Andersen 0f835b5186 scripts: west: commands: completion: add bash completion for twister
Add bash shell completion for the "west twister" command.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-08 12:50:41 +02:00
Hake Huang 09e0fb9376 twister: openocd hander: add LPC script CMSIS-DAP support
add LPC script CMSIS-DAP support

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-05-07 18:02:53 -04:00
Hake Huang fcb4e52d86 west: openocd: find path intree
when run package from another PC, the openocd path
may not the same, so try to use ZEPHYR_BASE when
not aligned

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-05-07 18:02:53 -04:00
Théo Battrel b2e235d530 Bluetooth: Remove legacy debug symbols
The `BT_DEBUG_*` Kconfig symbols have been deprecated for more than 2
versions, remove them.

Update code that was still using them.

Remove the Bluetooth specific `Kconfig.template.log_config_bt` and use
`Kconfig.template.log_config_inherit` from the logging subsystem
instead, now that the legacy symbols can be removed.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-05-07 09:49:27 +02:00
Lukasz Mrugala b2f43210de scripts: Loader change
CSafeLoader used instead of yaml.safe_load and SafeLoader.
C implementation is faster.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-05-07 09:38:00 +02:00
Lukasz Mrugala 3d00574d33 scripts: twister: New find_v2_boards() function
Current find_v2_boards() has a lot of unnecessarry fluff.
We can make a new version of that function without it
given its use in TestPlan.add_configurations().

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-05-07 09:38:00 +02:00
Lukasz Mrugala a294a9a9ab scripts: twister: Name prefix loading
Sped up Twister via name prefix loading.
If the only thing influencing the platform selection
is the platform filter (-p), then we only load *.yaml
files that start the same way as those selected platforms.
We split the platform name to the first '/' or '@'.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-05-07 09:38:00 +02:00
Lukasz Mrugala 698df11446 scripts: twister: RegEx speedup
Replace unoptimal RegEx with a faster solution.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-05-07 09:38:00 +02:00
Pieter De Gendt f147a5fec2 spelling: Replace occurrences of "iff" with "if and only if"
Spell checking tools do not recognize "iff", replace with "if and only if".
See https://en.wikipedia.org/wiki/If_and_only_if

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-06 14:58:08 +01:00
Pieter De Gendt 947906de7e scripts: build: gen_kobject_list.py check _driver_api suffix
Raise an exceptionif _driver_api suffix is missing from subsystem name.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-03 14:44:41 +01:00
Swift Tian 5871ff010b devicetree: Add DT/DT_INST_CHILD_NUM and DT/DT_INST_CHILD_NUM_STATUS_OKAY
Add a generated macro for the number of child nodes of a given node.
Add a generated macro for the number of child nodes of a given node which
children's status are "okay".

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-05-03 11:18:43 +02:00
Alberto Escolar Piedras 09d554b769 native_simulator: Rework fuzzing support
The fuzzing support in the native_simulator had not got
to work yet. Let's remove it, and instead let the
test application handle it.

For this we make public the functions which initialize
the simulation and advance time, so the fuzzing tests
can use it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-02 20:46:03 +03:00
Andrej Butok 3216254730 scripts: runner: linkserver: Add flash support for Intel Hex files
Enables flash support for Intel Hex files,
added with LinkServer v1.5.30.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-05-02 09:58:20 +01:00
Yves Vandervennet d6b7412e72 west: linkserver: change to flash command line as required by v1.5.xx
There is no need to specify the core with the flash command line. This
is actually rejected with linkserver v1.5.xx and after.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-05-02 09:57:57 +01:00
Anas Nashif 7b9d4a2eff ci: check_compliance: use inclusive language
UNDEF_KCONFIG_WHITELIST ->   UNDEF_KCONFIG_ALLOWLIS

Fixes #72044

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-05-01 19:48:52 +01:00
Lukasz Mrugala ad210f7579 scripts: twister: Remove harness repeat field
Removed Harness's repeat field.

Added to schemas in e722db14ad,
together with the rest of harness_config.
Added to Harness when it was created.

Now present only in one sample -
mec15xxevb_assy6853 power management sample.

Could not find definitive proof whether it has ever been used.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-04-30 18:23:23 +02:00
Pieter De Gendt 65fb99a844 scripts: build: check_init_priorities.py: Add missing raise for error
An error was not raised.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-04-30 16:20:12 +02:00
Jamie McCrae 5033399322 scripts: list_hardware: Add check for soc.yml runner validity
Adds checking that qualifiers listed in a soc.yml file are valid
for the socs and cpuclusters defined in that file

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Jamie McCrae a0267d2f48 west: runners: Add run once commands and deferred reset
This adds supports for flashing images with sysbuild where there
are multiple images per board to prevent using the same command per
image flash which might cause issues if they are not ran just once
per flash per unique board name. A deferred reset feature is also
introduced that prevents a board (or multiple) from being reset if
multiple images are to be flashed until the final one has been
flashed which prevents issues with e.g. security bits being enabled
that then prevent flashing further images.

These options can be set at a board level (in board.yml) or a SoC
level (in soc.yml), if both are present then the board configuration
will be used instead of the SoC, and regex can be used for matching
of partial names which allows for matching specific SoCs or CPU cores
regardless of the board being used

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Sylvio Alves 568e777b84 twister: update overflow section name regex
esp32 platforms can overflow its dram0_0_seg and dram0_1_seg.
So update current dram section to meet both cases.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-04-29 17:41:15 +01:00
Alberto Escolar Piedras ec5d127f1f ci: coverage: typo fix in platform list
Fix quemu => qemu

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-29 17:40:56 +01:00