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>