This gives us the flexibility to exclude certain platforms'
simulator that's known to fail from running in Twister, but
allows real hardware to be tested.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
The current description of the relationship between the tests filter
and the arch/platform allow/exclude was actually incorrect.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Update twister to support running QEMU platforms with sysbuild, by parsing
domains.yaml and executing the "run" target of the default application.
This will allow twister to test QEMU targets with sysbuild. It is assumed
that QEMU targets will add any external images they need in the build
phase
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add support for building with sysbuild using twister, via the "sysbuild"
yaml property in testsuites. This will currently disable Kconfig and
devicetree filtering.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
stty operates on the file descriptor from stdin, but we want to operate
on stdout. If stdin and stdout are not the same tty then stty prints an
error.
Redirect stdout to stdin for stty calls.
Tested by running twister -T tests/subsys/shell </dev/null
Signed-off-by: Jeremy Bettis <jbettis@google.com>
When doing a split build and test with coverage enabled, (i.e.
`twister --coverage --build-only` followed by `twister --coverage
--test-only`), Twister attempts to run coverage reports immediately
after building, which fails because tests haven't actually run yet
and causes several error messages to print in to the log.
This change causes twister to skip the call to `run_coverage()` if
`--build-only` is set and print an info message. This suppresses the
error messages from the coverage report tool complaining about missing
coverage files, but still instruments the built code for coverage data
collection. When twister is invoked again, but with `--test-only`
instead, the coverage files will be emitted and the reports
successfully generated.
#### Testing
I ran...
```
$ zephyr/scripts/twister -T zephyr/tests/lib/cmsis_dsp/basicmath/
--coverage -p native_posix --build-only
$ zephyr/scripts/twister -T zephyr/tests/lib/cmsis_dsp/basicmath/
--coverage -p native_posix --test-only
```
... followed by a combined build and test ...
```
$ zephyr/scripts/twister -T zephyr/tests/lib/cmsis_dsp/basicmath/
--coverage -p native_posix
```
... as a control and diffed the HTML coverage reports, which were
identical other than a timestamp.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Do not modify testplan.json if it already exists. Testplan is only
created once and any work in the same worskpace should not change it.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Get options from passed environment class instead of using command line
options to the init function.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Remove unused arguments that became obsolete through the refactoring.
- filter_status
- only_failed
- json_report
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
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>
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>
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>