Fail a test run gracefully when an unknown test level
is requested to execute with the current test plan.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
The gen_kobject_list.py script looks at DWARF debug information in the
elf file to determine the address of variables. Make sure that when
looking at DW_FORM_exprloc, it looks at both DW_OP_addr and
DW_OP_plus_uconst.
Signed-off-by: Nick Goote <ngoote@gmail.com>
Make sure filters set by property-allowlist and property-blocklist
in an including binding are recursively applied to included bindings.
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Although the PropertySpec.path attribute is documented as
"the file where the property was last modified",
all property specs in Binding.prop2specs will claim
they were last modified by the top-level binding itself.
Consider:
- I1 is a base binding that specifies properties x and y
- I2 is an "intermediate" binding that includes I1,
modifying the specification for property x
- B is a top-level bindings that includes I2,
and specifies an additional property p
When enumerating the properties of B,
we expect the values of PropertySpec.path to tell us:
- y was last modified by I1
- x was last modified by I2
- p was last modified by B
However, the Binding constructor:
- first merges all included bindings into the top-level one
- eventually initializes specifications for all the defined properties
As a consequence, all defined properties claim they were last modified
by the top-level binding file.
We should instead:
- first, take into account their own specifications for the
included properties
- eventually update these specifications with the properties
the top-level binding adds or modifies
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Make sure the property specs answered by the Binding.prop2specs API
do not all claim (PropertySpec.path) they were last modified
by the top-level binding.
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Use 'runner_params' specified in hardware map YAML file. This allows to
configure custom params (like openocd's adapter configuration for
FT232-based probe) when used with pytest harness.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This adds volatile type qualifier to the struct declaration matching
when looking for blank line after declarations.
Before this commit, this structure was not accepted by chheckpatch:
struct cfg {
struct gpio_driver_config common;
volatile struct grgpio_regs *regs;
int interrupt;
};
checkpatch.pl generated the following warning:
-:158: WARNING:LINE_SPACING: Missing a blank line after declarations
#158: FILE: drivers/gpio/gpio_grgpio2.c:27:
+ struct gpio_driver_config common;
+ volatile struct grgpio_regs *regs;
With this commit, the warning is no longer generated.
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
Minor update to existing zspdx implementation to add support for
PrimaryPackagePurpose introduced in SPDX 2.3.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
os.path.abspath was mocked too broadly, leading to errors for some users,
while being undetected in the CI.
This change narrows down the mock effect, fixing the problem.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Take into account the Kconfig symbols in tests and samples that are
defined using the logging template.
This avoid using the `UNDEF_KCONFIG_WHITELIST` for those symbols.
Update the list to remove the symbols that were added for that reason.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Align with native_simulator's upstream main
6f6b359c4fe26ddeed8a65ad55f5bc402d3b7f91
Which includes:
* 6f6b359 Avoid issue with llvm address sanitizer
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Some NXP boards are not detected by twister when creating hardware map,
because manufacture name is NXP instead of NXP Semiconductors expected
by twister.
Fix it by adding NXP to manufacturers list.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
- Do not look CONFIG_* symbols from dynamic symbols which might
be there before the symbol table where CONFIG_* symbols are found.
- Define posix architecture in ARCHS list.
- Check if architecture is not found instead of letting the code
run into trying to access dictionary with None key.
Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
Treewide changes touching a single area or topic should have the
area/subsystem at the start of the commit message. Treewide is very
ambigous.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Improve Twister command line arguments for memory footprint:
* group and order footprint arguments meaningfully,
* clearer help descriptions,
* resolve logical inconsistences for combinations of arguments,
in particular:
`--last-metrics` now forces `--enable-size-report`,
`--show-footprint` now controls only detailed log output of
footprint deltas in comparison modes.
* align twister tests accordingly.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Refactor the skip collaborator logic to add log messages when a
collaborator is skipped because they self removed of not part of the
org.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
With commit f419ea7990 (runner: linkerserver : remove the probe ID
hardcode), support was added to use serial numbers with the linkserver
--probe argument. However, one invocation of the argument was missed,
and still used the "probe index" syntax. Resolve this issue.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
When sending commands containing something like "AT+CFUN" the expected
regex was not escaped and as a result such regex never matched what has
been echoed over serial.
Escape all commands with re.escape() so that echoed shell commands are
always matched, even when they contain special characters (like '+' in the
example above).
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Blackbox tests related to platform choice
now moved to test_platform.py:
* test_emulation_only
* test_exclude_platform
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Add test related to disable-suite-name-check flag
This flag disabling extended test suite name verification at
the beginning of Ztest test. This option could be useful for tests
or platforms, which from some reasons cannot print early logs.
Add test related disable-warnings-as-errors
Do not treat warning conditions as errors.
Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
The currently used PyYaml version has some vulnerabilies as
described on the pull request description. It updates to
version 6.0, removing these supply chain vulnerabily.
The OSSF Scorecard was the tool used for discovering
these vulnerabilties.
Signed-off-by: Javan lacerda <javanlacerda@google.com>
ANSI color is great for viewing output in a terminal, but currently it
also gets written out to the `handler.log` file. Text editors usually
don't render these, resulting in a hard-to-read file with a lot of
gibberish interspered. This commit strips ANSI sequences from lines
before writing them to the handler log file. This change does not
affect what is printed in Twister's console output, so one would still
see the colors there.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Since there is a K_THREAD_STACK_LEN, its kernel counterpart
should also be prefixed with K_ for consistency.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
linkserver is hardcoded to probe ID, now with #70343 merged
the probe ID restriction can be removed.
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
If `args.quiet` is set, suppress the useless `print` statements output
by `imgtool` (mcuboot script) by capturing `stdout`.
Old output:
```
[44/44] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 415192 B 824 KB 49.21%
RAM: 163124 B 256 KB 62.23%
IDT_LIST: 0 GB 2 KB 0.00%
image.py: sign the payload
image.py: sign the payload
```
New output:
```
[44/44] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 415192 B 824 KB 49.21%
RAM: 163124 B 256 KB 62.23%
IDT_LIST: 0 GB 2 KB 0.00%
```
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
commit 67bb6db3f8 ("syscall: Export all emitted syscalls, enabling
them for extensions") exports all emitted syscalls, however, it does
that only for the `z_mrsh` symbols, effectively only available for
userspace. If an extension running at kernel level tries to use a
syscall, it will fail to load.
This patch fixes that by exposing the `z_impl` symbols instead. However,
this is not as straightforward as the `z_mrsh` ones. As, in their
signatures, they can basically contain any type, it's not just a matter
of emitting `EXPORT_SYMBOL(z_impl_<syscall>)`, as the compiler will
complain about the undefined types. Here, there are a few approaches.
One of them is to have the `EXPORT_SYMBOL` being generated on the same
files where the syscall is implemented - injecting it there would allow
it to access all known symbols. But changing a lot of files is
undesirable, and it was one of the nice points of first patch.
Another one would be to reconstruct - or simply use the absolute path -
for the includes where the syscalls are defined. Reconstruct the paths
seems fragile and I'm not sure using absolute paths is portable.
Finally, the approach used in this patch is to declare, on a different
generated file, all `z_impl_` symbols as `void *` - after all, only the
address (and the name) to the function is relevant to EXPORT_SYMBOL. By
living in an compilation unit that doesn't include any header which
would expose any of the syscalls, there shouldn't be any conflicts. And
to account for the possibility that a syscall is not compiled - due
being configured out via Kconfig - all those symbols are also weak
aliases to a pointer to NULL. This file is then included in
`llext_export.c` (which should naturally not include any conflicting
header).
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Adds tests related to the addon flags:
* --enable-ubsan
* --enable-lsan
* --enable-asan
* --enable-valgrind
* --allow-installed-plugin
* --pytest-args
* -x, --extra-args
* extra test args for the binary
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Unfortunately this check as it is today is causing trouble, while
not checking too well for what it intended. Let's reduce its scope
until a better solution has been found.
Background:
This check intends to ensure coding guidelines Rules A.4 and A.5
are followed, but how it is implemented it does not work well enough.
1. These rules only apply to the kernel and some other parts of the
embedded codebase respectively, but this check is performed on the
whole tree.
2. This check works under the assumption that any attempt to set
these macros in source files is a violation of these rules, while
this is not necessary the case, as there are legitimate uses for these.
(Specially for _POSIX_C_SOURCE and _XOPEN_SOURCE)
This check also fails to detect these macros being set in cmake files,
so if users are faced with this failure they can trivially bypass it.
Having a CI check which produces too many false positives, while
at the same time being very easy to bypass is not a desirable situation
as that can result in lack of trust for this type of checks,
and an overall tendency to override these CI faults,
and overlooking actual violations of these rules by reviewers.
This check was originally added in
b021dece98
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
When iterating over `--arch-root`, `--board-root`, and `--soc-root`,
treat them as collections of absolute paths with no repeats, to ensure
that no input root has to be handled more than once.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Fixes: #69329
The board name was printed as part of printing board qualifiers because
those was being concatenated in the `board_v2_qualifiers()` method.
Keep the qualifiers separated from the board name and let the caller
concatenate the strings when required.
Completion scripts are also updated to handle the corrected behaviour.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
(cherry picked from commit 66b475a3aa)