Home
last modified time | relevance | path

Searched +full:twister +full:- +full:tests (Results 1 – 25 of 142) sorted by relevance

123456

/Zephyr-latest/scripts/tests/twister/
DREADME.md1 # Twister Testing
3 Running the tests require the environment variable ZEPHYR_BASE to be set.
5 Twister Testsuite are located in $ZEPHYR_BASE/scripts/tests directory with all the data files in $Z…
12 pip install -r $ZEPHYR_BASE/scripts/requirements-build-test.txt
20 pytest $ZEPHYR_BASE/scripts/tests/twister
23 ## Twister Coverage
25 The coverage for all the tests can be run using the command below. This will collect all the tests
28 coverage run -m pytest $ZEPHYR_BASE/scripts/tests/twister/
31 Then we can generate the coverage report for just twister script using
34 coverage report -m $ZEPHYR_BASE/scripts/pylib/twister/
[all …]
Dconftest.py4 # SPDX-License-Identifier: Apache-2.0
6 '''Common fixtures for use in testing the twister tool.'''
15 sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
29 data = ZEPHYR_BASE + "/scripts/tests/twister/test_data/"
39 return ZEPHYR_BASE + "/scripts/tests/twister/test_data/testsuites"
48 env.test_roots = [os.path.join(testsuites_dir, 'tests', testsuites_dir, 'samples')]
59 env.test_roots = [testsuites_dir + '/tests', testsuites_dir + '/samples']
Dtest_twister.py5 # SPDX-License-Identifier: Apache-2.0
7 This test file contains foundational testcases for Twister tool
18 sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
25 """ Test to check if loading the non-existent files raises the errors """
32 [("testsuite_correct_schema.yaml", "testsuite-schema.yaml"),
33 ("platform_correct_schema.yaml", "platform-schema.yaml")])
37 schema = scl.yaml_load(ZEPHYR_BASE +'/scripts/schemas/twister//' + schema)
44 [("testsuite_incorrect_schema.yaml", "testsuite-schema.yaml"),
45 ("platform_incorrect_schema.yaml", "platform-schema.yaml")])
49 schema = scl.yaml_load(ZEPHYR_BASE +'/scripts/schemas/twister//' + schema)
[all …]
/Zephyr-latest/.github/workflows/
Dtwister_tests.yml2 # SPDX-License-Identifier: Apache-2.0
4 name: Twister TestSuite
9 - main
10 - v*-branch
11 - collab-*
13 - 'scripts/pylib/**'
14 - 'scripts/twister'
15 - 'scripts/tests/twister/**'
16 - '.github/workflows/twister_tests.yml'
17 - 'scripts/schemas/twister/'
[all …]
Dtwister_tests_blackbox.yml2 # SPDX-License-Identifier: Apache-2.0
4 name: Twister BlackBox TestSuite
9 - main
10 - collab-*
11 - v*-branch
13 - 'scripts/pylib/twister/**'
14 - 'scripts/twister'
15 - 'scripts/tests/twister_blackbox/**'
16 - '.github/workflows/twister_tests_blackbox.yml'
19 twister-tests:
[all …]
Dtwister.yaml1 name: Run tests with twister
6 - main
7 - v*-branch
8 - collab-*
11 - main
12 - v*-branch
13 - collab-*
16 - cron: '0 3 * * 0'
19 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
20 cancel-in-progress: true
[all …]
Dclang.yaml6 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
7 cancel-in-progress: true
10 clang-build:
11 if: github.repository_owner == 'zephyrproject-rtos'
12 runs-on:
13 group: zephyr-runner-v2-linux-x64-4xlarge
15 image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
16 options: '--entrypoint /bin/bash'
18 fail-fast: false
22 CCACHE_DIR: /node-cache/ccache-zephyr
[all …]
/Zephyr-latest/doc/develop/test/twister/
Dtwister_blackbox.rst3 Twister blackbox tests
7 to understand existing files and create their own. All developers should fix any tests
9 important for any Twister developer.
14 Twister blackbox tests are written in python, using the ``pytest`` library.
17 Tests and data are wholly contained in the :zephyr_file:`scripts/tests/twister_blackbox`
20 Blackbox tests should not be aware of the internal twister code. Instead, they should
21 call twister as user would and check the results.
35 .. code-block:: console
37 twister -i --outdir $OUTDIR -T $TEST_DATA/tests -y --level $LEVEL
38 --test-config $TEST_DATA/test_config.yaml -p qemu_x86 -p frdm_k64f
[all …]
Dsample_blackbox_test.py4 # SPDX-License-Identifier: Apache-2.0
25 apath = os.path.join(ZEPHYR_BASE, "scripts", "twister")
39 # Select platforms used for the tests
42 path = os.path.join(TEST_DATA, "tests")
45 # Set flags for our Twister command as a list of strs
50 # * Select Zephyr tests to use
51 # * Control whether to only build or build and run aforementioned tests
52 ["-i", "--outdir", out_path, "-T", path, "-y"]
54 + ["--level", level]
56 + ["--test-config", config_path]
[all …]
/Zephyr-latest/doc/develop/test/
Dpytest.rst6 *Please mind that integration of twister with pytest is still work in progress. Not every platform
13 Pytest is a python framework that *“makes it easy to write small, readable tests, and can scale to
17 A pytest plugin ``pytest-twister-harness`` was introduced to provide an integration between pytest
18 and twister, allowing Zephyr’s community to utilize pytest functionality with keeping twister as
21 Integration with twister
24 By default, there is nothing to be done to enable pytest support in twister. The plugin is
25 developed as a part of Zephyr’s tree. To enable install-less operation, twister first extends
27 ``-p twister_harness.plugin`` argument. If one prefers to use the installed version of the plugin,
28 they must add ``--allow-installed-plugin`` flag to twister’s call.
30 Pytest-based test suites are discovered the same way as other twister tests, i.e., by a presence
[all …]
Dtwister.rst3 Test Runner (Twister)
6 Twister scans for the set of test applications in the git repository
14 Because of the limited test execution coverage, twister
17 tests for different boards and different configurations to help keep the
20 When using (at least) one ``-v`` option, twister's console output
24 of a test is likewise reported in the ``twister.json`` and other report files.
25 There are a few reasons why twister only builds a test and doesn't run it:
27 - The test is marked as ``build_only: true`` in its ``.yaml``
29 - The test configuration has defined a ``harness`` but you don't have
31 - The target device is not connected and not available for flashing
[all …]
Dcoverage.rst51 .. zephyr-app-commands::
53 :gen-args: -DCONFIG_COVERAGE=y -DCONFIG_COVERAGE_DUMP=y
58 the emulator with :kbd:`Ctrl-A X` for this to complete after the coverage dump
61 .. code-block:: console
63 ninja -Cbuild run | tee log.log
67 .. code-block:: console
69 ninja -Cbuild run | tee log.log
74 $ python3 scripts/gen_gcov_files.py -i log.log
80 $ find $ZEPHYR_SDK_INSTALL_DIR -iregex ".*gcov"
84 $ mkdir -p gcov_report
[all …]
/Zephyr-latest/scripts/west_commands/tests/
Dtest_twister.py3 # SPDX-License-Identifier: Apache-2.0
9 from twister_cmd import Twister
18 "r": ["-c", "-T tests/ztest/base"],
20 "T": [" tests/ztest/base"],
24 "r": ["--test-only"],
34 command="twister",
40 twister = Twister()
47 twister.parser = twister.do_add_parser(sub_p)
48 options = twister._parse_arguments(args=test_case["r"], options=None)
/Zephyr-latest/tests/boot/with_mcumgr/
DREADME.rst5 using **sysbuild**. Tests are automated with pytest, a new harness of Twister
13 To run tests with Twister on ``nrf52840dk/nrf52840`` platform,
16 .. code-block:: console
18 ./zephyr/scripts/twister -vv --west-flash --enable-slow -T zephyr/tests/boot/with_mcumgr \
19 -p nrf52840dk/nrf52840 --device-testing --device-serial /dev/ttyACM0
22 Twister requires ``--west-flash`` flag enabled (without additional parameters
28 .. code-block:: console
30 pytest zephyr/tests/boot/with_mcumgr/pytest --collect-only -v
/Zephyr-latest/tests/bsim/
Dgenerate_coverage_report.sh3 # SPDX-License-Identifier: Apache-2.0
5 set -eu
9 _generate_coverage_report.sh [-help]
10 Generate an html coverage report for BabbleSim tests
13 tests/bsim/_generate_coverage_report.sh
22 By default it takes all coverage information generated by all run tests
25 You can also merge in the twister coverage report by setting
27 TWISTER_COVERAGE_FILE=\${ZEPHYR_BASE}/twister-out/coverage.info
28 after having run twister, for example as
29 twister -p nrf52_bsim -T tests/bluetooth/ --coverage
[all …]
Dci.uart.sh3 # SPDX-License-Identifier: Apache-2.0
5 # This script runs the Babblesim CI UART tests.
9 export ZEPHYR_BASE="${ZEPHYR_BASE:-${PWD}}"
12 set -uex
14 echo "UART: Single device tests"
16 ${ZEPHYR_BASE}/scripts/twister -T tests/drivers/uart/ --force-color --inline-logs -v -M \
17 -p nrf52_bsim -p nrf5340bsim/nrf5340/cpuapp --fixture gpio_loopback \
18 -- -uart0_loopback -uart1_loopback
21 ${ZEPHYR_BASE}/scripts/twister -T tests/drivers/uart/ --force-color --inline-logs -v -M \
22 -p nrf54l15bsim/nrf54l15/cpuapp --fixture gpio_loopback \
[all …]
/Zephyr-latest/scripts/tests/twister_blackbox/
Dtest_footprint.py4 # SPDX-License-Identifier: Apache-2.0
6 Blackbox tests for twister's command line functions related to memory footprints.
17 # pylint: disable=no-name-in-module
31 r'Found [1-9]+[0-9]* footprint deltas to .*blackbox-out\.[0-9]+/twister.json as a baseline'
33 DELTA_WARNING_RUN = re.compile(r'Found [1-9]+[0-9]* footprint deltas to the last twister run')
37 DELTA_DETAIL = re.compile(RAM_KEY + r' \+[0-9]+, is now +[0-9]+ \+[0-9.]+%')
41 apath = os.path.join(ZEPHYR_BASE, 'scripts', 'twister')
61 path = os.path.join(TEST_DATA, 'tests', 'dummy', 'device', 'group')
62 args = ['-i', '--outdir', out_path, '-T', path] + \
63 ['--enable-size-report'] + \
[all …]
Dtest_addon.py4 # SPDX-License-Identifier: Apache-2.0
6 Blackbox tests for twister's command line functions concerning addons to normal functions
26 apath = os.path.join(ZEPHYR_BASE, 'scripts', 'twister')
41 (['--enable-ubsan'], '1')
48 test_path = os.path.join(TEST_DATA, 'tests', 'san', 'ubsan')
49 args = ['-i', '--outdir', out_path, '-T', test_path] + \
53 ['-p'] * len(test_platforms), test_platforms
68 (['--enable-asan', '--enable-lsan'], '1')
75 test_path = os.path.join(TEST_DATA, 'tests', 'san', 'lsan')
76 args = ['-i', '--outdir', out_path, '-T', test_path] + \
[all …]
/Zephyr-latest/scripts/ci/es_upload/
DREADME.md5 script for [Twister](https://docs.zephyrproject.org/latest/develop/test/twister.html)
9 with explicit scheme having all required Twister JSON report objects associated
11 Besides, it allows to track changes in Twister JSON report scheme
17 For other command line options and more details run the upload script with `--help`,
21 in the current Twister report format and in the upload script itself.
24 It is recommended to try the upload script with `--dry-run` option first
36 python3 ./scripts/ci/upload_test_results_es.py --create-index \
37 --index YOUR_INDEX_NAME \
38 --map-file YOUR_INDEX_MAP.json
44 The upload script has several command line options to change `twister.json` data:
[all …]
/Zephyr-latest/scripts/
Drequirements-build-test.txt1 # BUILD-TEST: required to do build tests of zephyr
3 # things used by twister or other things like code coverage or python
6 # used by twister for ansi color
9 # python lex/yex used by twister
16 # used for west-command testing
Drequirements-run-test.txt1 # RUN-TEST: required to do run time tests of zephyr
3 # things used by twister or related in run time testing
8 # used by twister for board/hardware map
15 # use for twister
19 python-can>=4.3.0
/Zephyr-latest/scripts/pylib/pytest-twister-harness/
DREADME.rst2 Pytest Twister harness
6 ------------
8 If you plan to use this plugin with Twister, then you don't need to install it
9 separately by pip. When Twister uses this plugin for pytest tests, it updates
11 ``-p twister_harness.plugin`` argument.
15 -----
17 Run exemplary test shell application by Twister:
19 .. code-block:: sh
24 ./scripts/twister -p native_sim -p qemu_x86 -T samples/subsys/testsuite/pytest/shell
27 …./scripts/twister -p nrf52840dk/nrf52840 --device-testing --device-serial /dev/ttyACM0 -T samples/…
[all …]
/Zephyr-latest/samples/subsys/testsuite/pytest/shell/
DREADME.rst1 .. zephyr:code-sample:: pytest_shell
4 Execute pytest tests against the Zephyr shell.
10 Twister test runner.
12 A simple application provides basic Zephyr shell interface. Twister builds it
13 and then calls pytest in subprocess which runs tests from
16 information about used kernel version. Both tests use ``shell`` fixture, which
17 is defined in ``pytest-twister-harness`` plugin. More information about plugin
28 Build and run sample by Twister:
30 .. code-block:: console
32 $ ./scripts/twister -vv --platform native_sim -T samples/subsys/testsuite/pytest/shell
[all …]
/Zephyr-latest/
D.ruff-excludes.toml1 # SPDX-License-Identifier: Apache-2.0
6 [lint.per-file-ignores]
8 "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
9 "UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
12 "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
13 "UP030", # https://docs.astral.sh/ruff/rules/format-literals
14 "UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
17 "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
18 "UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
19 "UP034", # https://docs.astral.sh/ruff/rules/extraneous-parentheses
[all …]
/Zephyr-latest/scripts/pylib/twister/twisterlib/
Denvironment.py4 # Copyright (c) 2018-2024 Intel Corporation
8 # SPDX-License-Identifier: Apache-2.0
29 logger = logging.getLogger('twister')
45 def _get_installed_packages() -> Generator[str, None, None]:
57 print(f"Currently, Twister requires at least Python {min_ver_str}.")
63 PYTEST_PLUGIN_INSTALLED = 'pytest-twister-harness' in installed_packages
71 def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
82 $ ./scripts/twister -v \\
83 --testsuite-root tests/ztest/base \\
84 --testsuite-root tests/kernel \\
[all …]

123456