Commit graph

3643 commits

Author SHA1 Message Date
Anas Nashif f2b5a6674a twister: move harness class to class folder
harness class moved along size other classes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 57dbaa3da3 twister: move more code from main script
Move code from twister script into respective classes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif f539f1dc48 twister: move size report into size calc class
Move from main script into size_calc class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 806722cdbf twister: move device testing code
Move device handling code into hardware map class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif f7d501447d twister: move cleanup and classification of code
Move code out of the main script and use global options.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 396b8574eb twister: testplan: move calls to json loading/filter into class
Move all code related to instance filtering and loading into the class
instead of having it in the main script. Simplify option passing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif f85d1eb4e1 twister: rework testplan and main twister script
Move all testplan related code to the testplan class and cleanup main
twister script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif b8735b3300 twister: more cleanup to option passing
Use global options rather than passing them individually.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif facc685ae9 twister: move runner code into runner class
Move all code related to test execution into runner class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 20f257a97d twister: move execution code out of testplan
Move all code related to execution into runner class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif d43e03e19e twister: isolate testplan class
Move testplan class into own file and rename the original twisterlib.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 96b9ff6b5e twister: move runner classes out
Move runners into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 1084869634 twister: minor cleanups in main script
Move code around in the main script and cleanup some of the options.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif e5c2e797c9 twister: move test instance class out
Move test instance class into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif adfa6c7777 twister: move coverage classes out
Move coverage related classes out into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 78d9dab7f3 twister: cleanup imports and move size classes out
More python import optimizations and cleanup and move size_calc class
out into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 75eee4b1f3 twister: move platform class out
Move both platform and config parser into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 0779ccc5fc twister: import cleanup
python import cleanup and simplification.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif f490b059ad twister: move handlers class out
Split handlers into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 2b213d3231 twister: split hardwaremap class out
Split hardware map class into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif d5424d5116 twister: split report classes out
Move report classes out into own file and split out of testplan class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif d8d217d2ea twister: move testsuite, testcase classes out
Move testsuite/testcase and supporting classes into own files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif 521ce42161 twister: move cmake cache class
Move cmake cache classes into own file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif e01cbbe31f twister: add environment class
Add environment class to discover toolchain, zephyr version and other
items.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Anas Nashif acda94be2d twister: optimize file scanning
We have been scanning code for tests for every scenario defined in the
yaml file. This needs to only be parsed once and not more. We are
dealing with the same files for each scenario.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-05 12:06:27 -04:00
Bartosz Bilas 888ce37799 runners: jlink: allow passing file path with spaces
Put file path within the " " marks to allow
passing file path with spaces.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-07-05 13:20:17 +02:00
Christopher Friedt 4cc443705d libc: minimal: add strerror and strerror_r function
Add simple strerror() and strerror_r() implementations.

Fixes #46099

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-07-04 22:53:36 +02:00
Enjia Mai ce18d3c4ff requirements: add netifaces, needed by adsp runner
Needed for running tests on intel_adsp_cavs boards, the cavstool.py
are using it to get the host ip address automatically.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-04 16:33:03 +02:00
Reto Schneider 35f9a32781 twister: Remove testcase-root reference
--testcase-root got renamed to --testsuite-root

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-07-02 19:24:58 -05:00
Sylvio Alves 60417bad79 scripts: runners: esp32: add erase option
Adds option for erasing esp32 SoC.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-07-01 16:25:34 +02:00
Henrik Brix Andersen e12d06690e scripts: west: openocd: respect pre-load and post-verify cmds for elf
Respect --cmd-pre-load and --cmd-post-verify when flashing ELF files
(--use-elf).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-07-01 16:12:52 +02:00
Anas Nashif 33dd2146bb twister: use original reason with qemu failures
If we already have recorded the reason during the qemu run, do not
override it at the final stage of status processing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-01 07:31:08 -04:00
Anas Nashif 1cdada84ff twister: also paese ZTEST_USER and ZTEST_USER_F cases
Parse additional ztest types with new API that were missed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-01 06:28:35 -04:00
Hake Huang 5ae7d41111 twister: test: add default harness check
below command line need has fixture configured in map.yml,
if not, it shall be skipped
twister -p frdm_k64f --device-testing \
--hardware-map map.yml -T tests/subsys/modbus/ -vv

add harness check with testcase harness by default
will fix this issue

Fixing: #46635

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-07-01 11:36:10 +02:00
Abramo Bagnara 795500bbe3 coding guidelines: comply with MISRA C:2012 Rule 9.3
MISRA C:2012 Rule 9.3 (Arrays shall not be partially initialized.)

Systematically use `{0}' to specify full 0 initialization
(not `{}', not `{0U}').

Signed-off-by: Abramo Bagnara <abramo.bagnara@bugseng.com>
Signed-off-by: Simon Hein <SHein@baumer.com>
2022-06-30 17:34:05 -04:00
Carles Cufi f9739ab41d python: Fix the requirement for libmagic to be installed
The Python python-magic module that we install for compliance checks
requires libmagic to be installed on the system to work. This requires
extra OS packages on Ubuntu and macOS, and an extra wheel on Windows.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-06-30 13:34:26 +02:00
Marc Herbert 9782b2cc05 scripts: intel_adsp: always invoke west sign
west flash invokes west build and we have no way to tell whether there
was any code change.

Also remove the rename() trick that achieved the same effect in a
a confusing way; just use copy() instead.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-06-30 10:34:30 +02:00
Marc Herbert 739aa951cd scripts: intel_adsp: don't invoke west sign with --tool-path None
When there is no rimage found in the path, don't invoke west sign with
"-tool-path None". This enhances the error message from the somewhat
cryptic:

  ERROR: --tool-path None: not an executable

... to the user friendlier:

  FATAL ERROR: rimage not found; either install it or provide --tool-path

Also log the complete west sign command at the "info" level before
running it to show that no signed firmware was found, to show which
rimage is used and in case other rimage problems arise. Invoking an
external command is an important "checkpoint".

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-06-30 10:33:53 +02:00
Henrik Brix Andersen 3d5cc38cf6 scripts: dts: gen_defines: define _TOKEN + _UPPER_TOKEN for string arrays
Generate definitions for *_IDX_n_TOKEN and *_IDX_n_UPPER_TOKEN for all
string-array type properties.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-06-28 20:46:11 +02:00
Henrik Brix Andersen 27820e9dcb scripts: requirements: extras: add clang-format
Add clang-format to the requirements-extras.txt and require a version
compatible with the configuration options present in the .clang-format
file.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-06-28 11:09:14 +02:00
Andrzej Głąbek fb3e8138a2 west_commands: nrfjprog: Add handling of data targeting the XIP region
When a hex file contains some data that needs to be programmed using
the QSPI peripheral (because it targets the XIP region), nrfjprog
needs to be provided with an option that specifies the QSPI erase
method to be used (otherwise, reprogramming will fail).
This commit adds the "--qspisectorerase" option when needed and it
also fixes the programming routine for nRF53, so that data for the
XIP region is not incorrectly interpreted as intended for the network
core.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Lauren Murphy 318e6db239 debug: coredump: add xtensa intel adsp, support toolchains
Adds compatibility with Intel ADSP GDB from Zephyr SDK and
from Cadence toolchain to coredump_gdbserver.py.

Adds CAVS 15-25 (APL) register definitions. Implements
handle_register_single_read_packet to serve ADSP GDB
p packets.

Prevents BSA from changing between stack dump printout
and coredump by taking lock. Observed to be necessary for
accurate results on slower simulated platforms.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-06-23 15:44:45 -04:00
Maciej Perkowski dfffc27039 twister: Delete less files during artifact cleanup
Option --runtime-artifact-cleanup/-M allows to clean build artifacts
during runtime to save space usage. However, if one wanted to combine
it with --build-only and then --test-only, they would get an error.
This commit expands the list of files stored with -M with files
required to made --test-only also to work afterwards. Such change can
be useful for setups where building is done on one node and then
minimal amount of artifacts are transfered to another one.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-06-23 09:11:40 +02:00
Jeremy Bettis 3b2d3129a5 west: Fix --openocd-search argument
Running west flash with the --openocd-search arg will result in the
openocd command being run with a -s param added for every character in
the passed DIR.

Fix the argparser to append all openocd-search DIRs into a list, instead
of just passing a string to the subcommand.

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2022-06-20 10:26:23 +02:00
Anas Nashif d63c2c44b5 ci: do not add assignees if already set
If PR already has an assignee, do not add additional assignees to the
PR. Each PR should only have one assignee (in most cases)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-17 11:56:07 -04:00
Gerard Marull-Paretas abaa5b8dfa scripts: checkpatch: allow leading spaces in multi-lines macros
With the current clang-format rules, we have that multi-line macros that
contain empty lines (usual in driver definition macros) are formatted
with spaces only, no leading tabs. For example:

```c
 #define MYDRIVER_DEFINE(i)                 \
 	 struct mydriver_data data##i;      \
                                            \ /* starts with spaces */
	 struct mydriver_config config##i;  \
	 ...
```

This patch makes checkpatch ignore such cases, so that clang-format can
be used in tree while keeping checkpatch happy.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-17 10:18:37 +02:00
Gerard Marull-Paretas d89dc22665 uncrustify: remove configuration file
Remove uncrustify configuration file in favor of using clang-format, a
tool that is nowadays more popular/powerful for code formatting.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:37:30 -04:00
Benjamin Gwin 3f8d5c49b3 twister: Exit with a bad status if there were build errors
Previously, twister would exit with a 0 status code if there were build
failures but no execution failures. This makes it easier to catch
build breakages when using twister in CI workflows.

Signed-off-by: Benjamin Gwin <bgwin@google.com>
2022-06-14 21:56:51 -04:00
Anas Nashif 071f62cb75 west: remove intel_s1000_crb runners
Remove runners specific to the intel_s1000_crb board. it is no longer
available or supported in the zephyr tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-13 16:19:51 -04:00
Adrian Bonislawski def0127f34 requirements: bump pyelftools to >=0.27
The minimum version of pyelftools is 0.27 to make it working
with databse_gen.py

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-06-10 09:46:31 +02:00
Anas Nashif 2e1814263e twister: rename add_missing_testscases
add_missing_case_status is more appropriate for this function.
We are adding missing status, not cases.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-09 12:15:28 -04:00
Anas Nashif 87be2f591f twister: rework how we discard tests
Add a filter type to distinguish between testsuite filters that are
maintained in the testcase.yaml file and those provided on the command
line.

The issue was that when something is excluded deliberately on the command
line twister would report an error if that filter would filter out an
integration platform. We do not want that, because the filtering is
being done by the caller knowing that some tests would be not run, even
if those are integration platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-09 12:15:28 -04:00
Ming Shao 0e79dc393c twisterlib: drain the serial leftover before new test
Some tests can cause serial leftover logs buffered on board.
A simple ser.flush() is not enough. So add explicit readline()
to drain such logs which prepares a clean serial context for
the case that follows.

Signed-off-by: Ming Shao <ming.shao@intel.com>
2022-06-09 06:35:48 -04:00
Anas Nashif 20483161b2 scripts: introduce script to set labels, assignees and reviewers
Use MAINTAINERS.yml file to set lables, assignees and reviewers for
specific PRs or all unassigned PRs since a given date.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-08 22:49:13 +09:00
Anas Nashif c62ee3be4e twister: remove fallback testcase if cases added at runtime
The fallback testcase, which is the scenario name from the yaml file is
added if we did not discover any testcases via parsing. It can be
removed if we discover testcaes at runtime or otherwise it is added as
skipped...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-07 06:02:00 -04:00
Anas Nashif bcf4e23562 twister: do not set case status on flash timeout
Status was set for testcases after a timeout on flash, which does not
abort the process and continues with test execution and eventually
passes the test.

Setting status on the testcases was done too early and before we have
executed the tests.

Also increase the flash timeout to 60s.

Fixes #45845

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-07 06:02:00 -04:00
Anas Nashif eeffdc373e twister: do not mark tests as blocked if a testsuite has passed
Do not set status as blocked on testsuites which passed. The sub cases
with no status will get a processed later.

Fixes #45845

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-07 06:02:00 -04:00
Martí Bolívar f6a6843471 python-devicetree: CI hotfix
Pin the types-PyYAML version to 6.0.7. Version 6.0.8 is causing CI
errors for other pull requests, so we need this in to get other PRs
moving.

Fixes: #46286

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-06-06 09:09:27 -07:00
Jordan Yates 57fa9121a1 scripts: gen_handles: injected device handles
Update the device handle array for injected devices to output device
handles, not device ordinals. This requires that the extra ordinals
provided to `DEVICE_DT_INST` map to an existing device in order to
appear in the final handle array.

This is required for the injected handles to be useful, no meaningful
operations can be done on device ordinals.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-06-05 14:26:39 +02:00
Jordan Yates 2e014ec1cb scripts: gen_handles: fix extra DEVICE_HANDLE_SEP
Remove an extra `DEVICE_HANDLE_SEP` that was being inserted into the
handle array when injected dependencies were present.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-06-05 14:26:39 +02:00
Enjia Mai 2674c44a59 twister: passing a pty pararmeter to intel_adsp runner
Add a pty parameter from twister to intel_adsp when west-flash,
to tell the intel_adsp runner to change the way it outputs the
log.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-06-05 14:13:57 +02:00
Enjia Mai 12c44aaec7 scripts: runner: add a intel_adsp west runner
Add a intel_adsp west runner instead of using misc-flasher for
intel_adsp boards. Now running the test on intel_adsp_cavs by:

  west build -b intel_adsp cavs25 ...
  west flash --remote-host [remote hostname or ip addr] \
             --rimage-tool [path to rimage tool] \
             --config-dir [path to dir of .toml config file] \
             --key [path to signing key]

The intel_adsp west depends on the cavstool_server.py running
on the remote host machine.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-06-05 14:13:57 +02:00
Martí Bolívar b964f0b156 scripts: add dump_bugs_pickle.py
This prints the contents of a zephyr-bugs-$DATE.pickle file in a
format similar to the output of list_issues.py.

It will be useful to have this in tree so that we can better record
the known issues at the time of a particular zephyr release.

The pickle file itself should be created using the bug snapshot
workflow defined in .github/workflows/bug_snapshot.yaml, which can be
triggered manually from this URL:

https://github.com/zephyrproject-rtos/zephyr/actions/workflows/bug_snapshot.yaml

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-06-03 19:19:25 -05:00
Evgeniy Paltsev 554aa9cde3 ARC: west: mdb runner: change folder to run MDB
Make the build folder the place where MDB is run. Otherwise mdb
will store the .sc.project folder in the place where twister is
launched (so .sc.project folder will be shared across the runs)

For that we add **kwargs argument to popen_ignore_int method
so we can pass a cwd argument to the Popen constructor.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2022-06-02 13:09:51 +02:00
Ming Shao 33795e3776 twisterlib: fix the execution time for device testing
At the end of DeviceHandler.handle(), the execution time
should be recorded no matter what the harness.state is.
This reflects how much time has been spent on the device.
And it is also used later to determine if a test has been
attempted on a real device or just build-only.

Signed-off-by: Ming Shao <ming.shao@intel.com>
2022-05-30 10:30:00 +02:00
Fabio Baltieri 93f20d7a7a include: add zephyr/ on script generated #include
Fix few script generated #include that needed the zephyr/ prefix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Hake Huang 75845f5f4e test: twister: fix false negative in device test
in device test when harness is Test, if there is no console output,
the self.state is None, as at this time self.instance.state
is "pass", as the last step cmake is "pass". So it will report "pass",
but actually there is no console output issue

you can easily reproduce this issue by set
line='' at the begining of the Test.handle function

fixing: #45942

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-05-26 11:39:14 +02:00
Stephanos Ioannidis 39956ec835 twister: Add option to always force color output
Colorama, by default, strips out the color escape characters when the
output is redirected, and this may have an unintended consequence of
disabling color outputs when using a utility such as `tee` and in the
CI runners that redirect the stdout and stderr console outputs.

This commit adds a new command line option called `--force-color` to
always force the ANSI color escape sequence output even when the output
is redirected.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-25 12:48:31 +09:00
Yuval Peress 86cadf9283 ztest: Fix userspace ztests in new API
Update the new API to use K_USER as the flags for both
CONFIG_USERSPACE and CONFIG_TEST_USERSPACE. Also, fix the linker
script to properly include the suites, tests, and rules.

Fixes #44108

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Martí Bolívar 78edc12c1b scripts: add make_bugs_pickle.py
This is a simple script which snapshots open bugs in the
zephyrproject-rtos/zephyr repository using the GitHub REST API.

It relies on the 'github' module, which is a de-facto standard for
accessing this API in Python:

  https://pygithub.readthedocs.io

We are already using this package in scripts/release/bug_bash.py, so
this is not a new dependency, even though it's a third party package
not available in the standard library.

The resulting bugs are stored in the standard library's 'pickle'
format, as a list of github.Issue.Issue objects. For more on pickle,
see:

  https://docs.python.org/3/library/pickle.html

I am choosing pickle because it is standard, easy to use, and we are
already using it in the build system to store the edtlib.EDT object
created by gen_defines.py. This is also therefore not a new
dependency (and even if it were, it's in the standard library).

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-05-24 18:48:03 +02:00
Martí Bolívar 8aaea6d200 scripts: add github_helpers.py
This is meant to be a place where we can store generic zephyr wrappers
around the de-facto standard github API for python.

The first 'customer' will be a script that snapshots our open bugs at a
particular point in time, which will be added in a later patch.

I think it's useful to factor this file out of there from the
beginning just to keep things clean, even though I don't have a second
customer in mind at the moment.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 18:48:03 +02:00
Stephanos Ioannidis e332ddb5b4 scripts: tracing: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Stephanos Ioannidis 847ff98bb3 scripts: dictionary: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Stephanos Ioannidis 2ee02f9dfa scripts: fpdiff: Initialise Colorama during start-up
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Stephanos Ioannidis aae454708d twister: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Note that the init function needs to be called per module, hence it is
also called in the `twisterlib.py`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Anas Nashif 88d4299d88 scripts: fpdiff: iterate on namespaces
Iterate on 3 main namespace to avoid collision in identifiers sharing
the same name at the top level when creating the diff.

Fixes #44940

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-24 08:57:55 -07:00
Erwan Gouriou 4d073a755d scripts: west: openocd runner: Add an option to specify target handle
Provide a way to specify the openocd target script handle used to
describe the core target.
In most target scripts '_TARGETNAME' is used, but it can happen that
'_TARGETNAME.foo' or '_CHIPNAME.bar' is used, specially on SoCs subject
to multicore.

Today, this option is required to enable rtos thread awareness,
using '$_TARGETNAME configure -rtos Zephyr' command, which is generated
by this runner.
It could be useful for similar needs in future.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-24 08:52:16 -07:00
Jordan Yates 06aae61019 scripts: zspdx: fix writing custom license IDs
The builtin list function `.sort()` sorts the list in-place and returns
None. As this is an invalid type for iteration, use the builtin `sorted`
function, which returns a sorted copy of the list, which we can iterate
over.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-23 10:18:06 +02:00
Fabio Baltieri bd61ced760 twister: fix wrong flag name in the helpdoc
The flag --testcase-root has been renamed to --testsuite-root in

15bc98eb50 twister: rename TestCase -> TestSuite

Fix the --help text to reflect the change.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-20 19:22:20 -07:00
Henrik Brix Andersen c6b3094d5e scripts: kconfig: kconfigfunctions: use relative ZEPHYR_BASE path
Use a path relative to the script itself to determine the ZEPHYR_BASE path
instead of relying on the environment variable.

This allows for modules to use the Zephyr kconfiglib without having
ZEPHYR_BASE set in the environment.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-05-18 11:02:26 -07:00
Stephanos Ioannidis f2b0991147 scripts: check_compliance: Fix broken links to Contribution Guidelines
This commit fixes the broken links to the Contribution Guidelines in
the Compliance Check script.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-17 13:40:27 -04:00
Anas Nashif 734c345457 twister: sort hardware map based on id
Serial is not required, in some cases it might be set to null or we
might be using serial_pty, so sort existing map file based on ID
instead.

Fixes #45713

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-17 08:29:42 -04:00
Chen Peng1 ca08d2e4a6 twister: ignore serial device SerialException.
For some boards, like up_squared and ehl_crb, they need do a
power off/on operation and use bios to load and execute zephyr
test binary, during the power off, it may meet this SerialException,
but the serial object still works well after power on, we can continue
to get all results from serial, so we don't need to close it,
it's ok to ignore this exception.
BTW, even if we ignore this exception here, it doesn't influence twister
function, because if it was really caused by disconnection, the test would
still be judged as failed due to timeout and serial would be closed later
in main thread, it doesn't impact results.
On the contrary, close serial directly in the monitor serial thread, it
will cause later tests failed due to mismatch errors.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2022-05-16 16:55:42 +02:00
Anas Nashif a6f924db7f twister: add support for platform_type filter
Instead of relying on runtime filter to limit scope to emulation
platforms, use the type attribute for each platform and do the filtering
very early on. This will speed things up for tests where we only run on
emulation platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00
Daniel DeGrasse fbefc50a9c scripts: kconfig: add dt_chosen_has_compat
Add dt_chosen_has_compat kconfig helper function. This function checks
if a given `chosen` node has a provided compatible string in its
compatible list. Returns "y" if compatible string is present, and "n"
otherwise.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-13 10:57:08 -07:00
Jordan Yates 8e4107f9be scripts: ensure intended path for edtlib imports
When updating `sys.path` to allow importing the pickled edtlib instance,
add the path to the front of `sys.path`, not the end. This ensures that
the `devicetree.edtlib` module that is imported is the one relative
to the files being run, not some other version which may exist on the
path.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-13 10:09:45 -07:00
Anas Nashif f089f964fd twister: update ci options for twister
Now that we have partially oerhauled twister in the tree, modify actions
with new options:
- not reporting filtered tests is now default
- output is json, not csv

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:57:37 -04:00
Anas Nashif 3ae685ef8d twister: for ci and in twister.yml, treat built tests as passed
For CI and for the condensed version of the report, consider built tests
as passed and do not mark them as skipped. Tests that are built only
will be reported as skipped in the full and suite reports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif bd1b364c2e twister: do not report filtered tests by default
Filtered tests are now not being reported by default to allow generation
of reports that are easier to parse and work with in different tools.

The complete filtered set of tests is still available in the json output
for review and verification.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 0313c5ce6f twister: hwm: rename forgotten connected_hardware -> duts
This was forgotten from an early overhaul, fix this as
connected_hardware attribute does not exist anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 7a83d4fe02 twister: reports: add timestamp to junit report
Add a timestamp to junit reports as per specification.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif fd75aa6286 twister: generate junit report with testsuites rather than platforms.
We have been generating reports with the platform being used as the
testsuite, ie. all testcases would land under one single big testsuite,
which is very difficult to use or read.

This change uses testsuites as intended and does that for each defined
testsuite (or scenario). Platforms are added as properties among other
things.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 6404988e3b twister: fix setting of reason value on tests to be run
When loading tests from json file we want to reset the reason for those
tests that are to be run and remove whatever we had when the test was
only built.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif c8adf8808c twister: set type of built only tests correctly
we mark built only tests as skipped, however, the type was still the
same as other skipped tests, set this to 'built' to indicate the tests
was only built.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif bad8a0f9ef twister: xunit: we do not use the results of xunit
Remove return that is not being used anywhere.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif c5ea3af001 twister: fix hardware map generation an serial detection on mac
Do not fail on serial not being available.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif d5a5cc131f twister: cleanup status and reason setting
Remove some legacy code and set status and failure/skip reason directly
without set_state and get_state.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 03dca681d3 twister: fix status handling on build errors and overflows
Handle build errors due to overflows correctly and do not report those
as failures if not requested.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif c88d8c07c7 twister: fix --build-only followed by --test-only usecases
Set status correctly when building and executing tests in 2 different
steps.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif bf48c12b14 twister: set status for subcases when blocked
When we have a build failure or anything that would prevent execution of
the test, set the status for all subcases accordignly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 7f3a62f2ce ci: keep old name of testplan file for now
Until we are ready to change workflow file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 41cb42d4db ci: testplan converted to use json
twister now exports json instead of csv, so we make the testplan read
the json data and generate the consolidated plan for the workflow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 7d23e509a3 twister: finetune reporting for misconfigured testsuites
Report misconfigued testsuites and subcase parsing issues instead of
erroring out. This should help us fix those tests and then enforce
accurate result capturing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 9328285b1d twister: status: fix status evaluation
Fix some inconsistencies with status and execution time setting in
multiple areas.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 79693590d4 twister: reporting: set default status to 'Unknown'
Set status to unknown when we do not have any status set or status is
None.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif c820ffe18c twister: remove unused arguments in reporting functions
Remove unused arguments that became obsolete through the refactoring.
- filter_status
- only_failed
- json_report

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif b156f2dbea twsiter: also count errors for the plan
Count the errors found during setup and update counter.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif dbd460fd04 twister: apply_filter: discards is not part of TestPlan
Use class member instead of local variable of discards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 26e3c30234 twister: report: capture failures per testcase
Capture failures per testcase so that we can include the output in
reports for only failed testcases and not include the whole log which
can be overwhelming.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif b86895adbb twister: reports: attach logs to xunit reports
This was missed in the report generation step, we now add them to the
xml file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 58f1926c93 twister: xunit: Fix conversion to text alignment
Do not create testsuite entries if all tests are being filtered.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif ab15d1ad8b twister: tests: remove tests of dropped features
Removed tests for dropped functionality.

Renamed classes and files to reflect new structure.

As we refactor the reporting infrastructure, tests will follow once we
have everything in place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 61f11536f9 twister: fix initial stats about discards
Fix discard stats in the summary.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 8e805596d5 twister: support defining testcases in yaml file
Some complex testsuite use macros and other mean to define testcases
which makes them unparseable. This ends up in a descripency between the
testplan and the test results.

Allow adding the testcases into the yaml and use those instead of
parsing the C files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif e08760e507 twister: support per case duration
We are now able to capture individual case duration and can display this
as part of the reports instead of using the overall test instance
execution time.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 4a1695acf5 twister: add testcase class
Now we can add the TestCase class which will hold all information about
individual testcases, their status and why they are not passing, etc.

Test cases are parsed initially and testsuite is populated with the list
of testcases it contsins. This list is duplicate for each instance
(scenario) and used to capture test case data.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 111097098e twister: rename more testCase -> testsuite usages
More renaming and change to variable names to make it less confusing.
Especially, renames of tc to become ts where applicable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 15bc98eb50 twister: rename TestCase -> TestSuite
TestCase in the old terminology is the test application, but we have
just freed up TestSuite, so use TestSuite here to signify the test
application which consists of many test scenarios and testcases.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 7424c65779 twister: rename TestSuite -> TestPlan
Change terminology and fix usage based on the current hierarchy. A
testsuite is each test application we have in the tree. The top class is
where we detect all the test suites and create the testplan to be run
later.
Content of testplan will have to split out, so it only deals with the
plan and not the overall execution of tests. This step will be done at a
later point.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif d70b267e3e twister: set correct status when loading json
When loading json, make sure we set the status correctly depending on
the type of the testscase.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif ba8b557433 twister: fix some pylint issues
Fix a few pylint issues after the refactoring.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 2de0366784 twister: re-enable report filtering
Re-enable option to filter out skipped test cases as a result of
configuration or runtime filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif c9daae592a twister: fix reporting of status and duration
Various fixes to reporting and filtering of results.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif eba9792a1b twister: generate unit from json
We now have all the logic for generating data suitable for reports in
one single place (json). The junit reports and in the future other
reports will be using this as input and generate reports using the json
data.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 1de0a3dc93 twister: remove release data handling
An obsolete feature that is no longer being used due to the amount of
data that is needed per release and the fact it becomes stale very fast.
Instead, point to files directly for comparison.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 106521074e twister: remove --export-tests option
We now have a better format for exports (json), use that instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 3dcc038274 twister: use json instead of csv for everything
Drop CSV generation which was the standard for sharing information since
the early days and instead use json with more content to share
information across sessions and for report generation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 17b654c19f twister: rework json reports
Refine structure and accomodate more data, this report will serve as the
source for a testplan, reports and retries.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif d5dbeb2f17 twister: improve reporting of filtered and built cases
Specify why something was skipped (either filtered or through a ztest
case) and do not report testcases that are only being built as passed,
mark those tests as skipped with the reason specified as "Build only".

Keeping --no-skipped-report for now, although it has no impact.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif ffc37f38e5 twister: move noop options out
Many option cancel out very already on,. so lets do this as part of the
option processing function first before we create workspace.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 57fa5fbb6d twister: move logging setup into own function
Cleanup main() and move logging code into own function.
This reduces clutter in main function and simplifies workflow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Aastha Grover eee56d8840 scripts/check_complaince: Add configs to UNDEF_KCONFIG_WHITELIST
Adding LOG_BACKEND_MOCK_OUTPUT_DEFAULT &
LOG_BACKEND_MOCK_OUTPUT_SYST to UNDEF_KCONFIG_WHITELIST as Kconfig
options generated by a template under testcases are not
identified by Compliance check by default.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-05-12 07:39:06 -04:00
Al Semjonovs ce54efaf70 twister: Add seed as argument for native_posix builds
Use the seed as arg for ZTEST_SHUFFLE enabled builds

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2022-05-11 12:14:31 -04:00
Enjia Mai 4966de2014 twister: add a hardware map support for using serial pty
The hardware map feature can be used with serial pty mode in
this change. And also add an runner_params option for passing
more parameters from hardware map file to west runner. Note
that you need to create this map file manually because it
cannot be scanned out correctly due to pty is not a physical
HW device existing in system.

And also update doc/develop/test/twister.rst for the usage.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-05-11 05:54:23 -04:00
Gerard Marull-Paretas 0d18e911fc scripts: utils: add include migration script
All includes are now prefixed with <zephyr/...>, even though the old
include paths can still be used when CONFIG_LEGACY_INCLUDE_PATH=y, an
option still enabled by default. Migrating large projects can be tedious
and time consuming. This patch provides a script that can be used to
migrate any Zephyr-based project to the new include path. It is used
like this:

  python $ZEPHYR_BASE/scripts/utils/migrate_includes.py \
         -p path/to/zephyr-based-project

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-11 10:55:35 +02:00
Mark Holden d04ab82943 coredump: adjust mem_region find in gdbstub
Adjust get_mem_region to not return region when address == end
as there will be nothing to read there. Also, a subsequent region
may have that address as a start address and would be a more appropriate
selection.

Signed-off-by: Mark Holden <mholden@fb.com>
2022-05-10 15:26:31 -04:00
Esteban Valverde 74ae6f654e scripts: west_commands: runners: add runner for Cyclone V SoC FPGA DK
Add a runner to "flash" and "debug" Cyclone V SoC FPGA Development Kit
the runner is based on OpenOCD and GDB

Signed-off-by: Esteban Valverde <esteban.valverde.vega@intel.com>
2022-05-10 13:29:47 -04:00
Tristan Honscheid dbbe80226d twister: Fix dependency on west when checking for projects
Twister should be partially usable even without West installed, however,
Twister unconditionally tries to import it when initializing to check
for west projects and crashes if it is not there.

This PR changes the behavior to return None if the west imports failed,
which appears to be more in line with what was intended. This allows
Twister to proceed and successfully run tests in a non-west environment.
There is no impact on environments that do have west installed.

Fixes #45355

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-05-09 13:48:17 -07:00
Daniel Leung 2e2c8cc931 scripts: logging/dictionary/sys-t: log module info in collateral
This updates the MIPI Sys-T collateral generation to include log
modules in the XML file. This allows the parser to show where
each log message is coming from.

Note that the addition of Name propety in sys:Client is to clarify
that this collateral is from Zephyr.

Also note he addition of Mask property in syst:Guid is for parser
to match this collateral to any incoming messages, as the module
IDs are encoded in the set bits in the GUID. Without the mask,
the parser will discard any messages with non-zero module IDs.
This is based on the observation of the reference parser,
systprint, where pseudo GUIDs are generated from the module/unit
IDs (origin unit) in the incoming messages for matching with
collaterals.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-05-09 12:54:53 -05:00
Gerard Marull-Paretas 8f09118b4a scripts: gen_handles: update to handle <zephyr/...> include prefix
Update the script so that it handles generates files using the
<zephyr/...> include prefix.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Gerard Marull-Paretas cf8d9f88fe scripts: gen_syscalls: update to handle <zephyr/...> include prefix
Update the script so that it handles generates files using the
<zephyr/...> include prefix.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Anas Nashif 94b316eacf ci: testplan: limit test scope on global changes
When doing global changes, like typo fixes or header changes, keep
default scope and do not build each test for each platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-06 08:19:49 -04:00
Evgeniy Paltsev 7353ea5886 twister: implement platform-specific test timeout management
Twister allows us to control maximum execution time for each
test with timeout value in test .yaml configuration. This
helps us to prevent slow tests from stopping by timeout.

However it's hard to choose test timeout for all platforms
as some platforms are naturally slow. It could be a HW board with
power-efficient but slow CPU or simulation platform which
can perform instruction accurate simulation but does it slowly.

As we don't want to increase test timeout infinitely to meet
the needs of the slowest platform let's introduce
platform-specific test timeout management. It's implemented as
an optional 'timeout_multiplier' field in board .yaml
configuration. Setting it to some value multiplies each test
timeout by this value. By that we can increase timeouts only
for the platforms where it's required.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2022-05-04 19:01:11 -04:00
Maciej Perkowski 53d3aa199d twister: Modify twister test for run_id in csv files
CSV file is expanded to store run_id and the corresponding test
requires a modification.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-05-04 09:39:50 -05:00
Maciej Perkowski edcc85d3d5 bugfix: twister: Store run_id in csv meta file so it can be reused
A unique run_id is now also added to the twister.csv file. This
file is used to store meta-data, in particular for `--test-only`
option. The run_id is then reused in `--test-only` calls to verify
if the id from readout matches the expected one.

fixes: #45278

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-05-04 09:39:50 -05:00
Fabio Baltieri d42b2e6bed scripts: gitlint: block Change-Id tags in commit message
Add a new gitlint user rule to block unwanted commit tags, and set it up
to block Gerrit Change-Id tags.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-04-20 20:59:33 -04:00
Bartosz Bilas fc88ddf59c scripts: checkpatch: add Co-authored-by tag
Add Co-authored-by tag which is mainly used by Github.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-04-21 02:02:39 +09:00
Stephanos Ioannidis 5a93798b22 Revert "scripts: check_compliance: check for commit message errors"
This reverts commit e61c534e52, which
enabled commit message checking via the checkpatch script.

The checkpatch commit message checking is currently causing more
problems that it fixes, for example:

1. the rules that are supposed to be specific to the "header" (commit
   message) are being applied to the diffs.

2. there are some rules that do not fully make sense for the Zephyr
   and the way we have been doing things.

Note that we currently have the 'gitlint' checking the commit messages,
so reverting this feature does not completely take away the commit
message checking in the CI.

If we are to ever re-introduce this feature, all of the aforementioned
issues need to be addressed, and the effects and ramifications of
enabling this feature must be thoroughly analysed.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-20 22:31:57 +09:00
Anas Nashif f429f339fc twister: allow filtering based on modules
Support new keyword in the testcase.yaml to allow filtering based on
enabled modules. This is useful when you only whitelist a limited set of
modules in your project and want to only run those samples that have
their dependencies satisfied and those modules available.

The option allows adding multiple modules, all of which need to be
enabled in the manifest.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-19 09:38:55 -04:00
Piotr Golyzniak b029bfd65c twister: set encoding during open log file
Set the same encoding for collected CMake output and file where this
output will be saved.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-04-19 08:40:34 -04:00