Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Maciej Perkowski 61e9de5ec4 twister: Minor quarantine fixes 4 weeks ago
..
pytest_integration twister: harness: introduce shell harness 5 months ago
test_data twister: Remove 'xtools' toolchain variant references 6 months ago
README.md twister: fixups to various files 3 years ago
conftest.py twister: Cleanup twister loggers 4 months ago
test_cmakecache.py scripts: tests: twister: CMakeCache test expansion 2 years ago
test_config_parser.py scripts: twister: drop support for space-separated lists 7 months ago
test_environment.py scripts: Fix CMake spelling 8 months ago
test_errors.py twister: test: update test case 7 months ago
test_handlers.py twister: handlers: Pass harness reason to instance 7 months ago
test_hardwaremap.py scripts: Fix twisterlib for ruff - UP015 7 months ago
test_harness.py twister: harness: fix Ztest case summary pattern 3 months ago
test_jobserver.py scripts: twister: Fix Unit Tests on Windows systems 1 year ago
test_log_helper.py scripts: tests: twister: Add log_helper tests 2 years ago
test_mixins.py python: Format and sort imports 8 months ago
test_platform.py twister: Account for board & SoC extensions 5 months ago
test_quarantine.py scripts: twisterlib: Enable multiple simulator support in twister 8 months ago
test_runner.py twister: Adjust status for quarantined instances 1 month ago
test_scl.py twister: fix utf-8 encoding for device handler 2 years ago
test_testinstance.py twister: harness_config extended by test retries in testcase.yaml 2 months ago
test_testplan.py twister: Minor quarantine fixes 4 weeks ago
test_testsuite.py twister: test: update test case 7 months ago
test_twister.py scripts: Fix twisterlib for ruff - B028 7 months ago

README.md

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.

Dependencies

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

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