tree: 4d68790d31e29533a5ff411ba0d52ce6d8f8803e [path history] [tgz]
  1. test_data/

Twister Testing

Running the tests require the environment variable ZEPHYR_BASE to be set.

Twister Testsuite are located in $ZEPHYR_BASE/scripts/tests directory with all the data files in $ZEPHYR_BASE/scripts/test_data directory.


Install all the dependencies using

pip install -r $ZEPHYR_BASE/scripts/requirements-build-test.txt

Executing testsuite

The testcases can be executed from the root directory using

pytest $ZEPHYR_BASE/scripts/tests/twister

Twister Coverage

The coverage for all the tests can be run using the command below. This will collect all the tests available.

coverage run -m pytest $ZEPHYR_BASE/scripts/tests/twister/

Then we can generate the coverage report for just twister script using

coverage report -m $ZEPHYR_BASE/scripts/pylib/twister/

To generate the coverage report for twister script use below command

coverage report -m $ZEPHYR_BASE/scripts/twister

The html coverage report for twister can be generated using

coverage html twister

If needed,the full coverage html report can be generated in every run of “pytest” in the tests directory using configuration file (setup.cfg).

Organization of tests

  • Contains common fixtures for use in testing the twister tool.
  • : Contains basic testcases for environment variables, verifying testcase & platform schema's.
  • : Contains testcases for Testsuite class (except reporting functionality) in
  • : Contains testcases for Testinstance and Testcase class.
  • : Contains testcases for reporting functionality of Testsuite class of twister.