Home
last modified time | relevance | path

Searched +full:pytest +full:- +full:twister +full:- +full:harness (Results 1 – 25 of 38) sorted by relevance

12

/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
10 :envvar:`PYTHONPATH` variable, and then extends pytest command by
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
[all …]
Dsetup.cfg2 name = pytest-twister-harness
4 description = Plugin for pytest to run tests which require interaction with real and simulated devi…
8 Development Status :: 3 - Alpha
26 pytest>=7.0.0
/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 …]
/Zephyr-latest/doc/develop/test/
Dpytest.rst3 Integration with pytest test framework
6 *Please mind that integration of twister with pytest is still work in progress. Not every platform
7 type is supported in pytest (yet). If you find any issue with the integration or have an idea for
13 Pytest is a python framework that *“makes it easy to write small, readable tests, and can scale to
14 support complex functional testing for applications and libraries”* (`<https://docs.pytest.org/en/7…
15 Python is known for its free libraries and ease of using it for scripting. In addition, pytest
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
[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
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
32 - You or some higher level automation invoked twister with
[all …]
/Zephyr-latest/scripts/tests/twister_blackbox/
Dtest_addon.py4 # SPDX-License-Identifier: Apache-2.0
6 Blackbox tests for twister's command line functions concerning addons to normal functions
13 import pytest
26 apath = os.path.join(ZEPHYR_BASE, 'scripts', 'twister')
35 @pytest.mark.parametrize(
41 (['--enable-ubsan'], '1')
49 args = ['-i', '--outdir', out_path, '-T', test_path] + \
53 ['-p'] * len(test_platforms), test_platforms
57 pytest.raises(SystemExit) as sys_exit:
62 @pytest.mark.parametrize(
[all …]
/Zephyr-latest/scripts/pylib/pytest-twister-harness/tests/
Dconftest.py3 # SPDX-License-Identifier: Apache-2.0
11 import pytest
17 @pytest.fixture
18 def resources() -> Path:
23 @pytest.fixture
24 def zephyr_base() -> str:
27 pytest.fail('Environmental variable ZEPHYR_BASE has to be set.')
32 @pytest.fixture
33 def twister_harness(zephyr_base) -> str:
34 """Retrun path to pytest-twister-harness src directory"""
[all …]
Dplugin_test.py3 # SPDX-License-Identifier: Apache-2.0
9 import pytest
14 @pytest.mark.parametrize(
33 pytester: pytest.Pytester,
52 '--twister-harness',
53 f'--build-dir={build_dir}',
54 f'--device-type={device_type}',
55 '-p', 'twister_harness.plugin'
/Zephyr-latest/tests/boot/with_mcumgr/
DREADME.rst5 using **sysbuild**. Tests are automated with pytest, a new harness of Twister
9 Pytest uses the MCUmgr fixture which requires the ``mcumgr`` available
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
25 Test scripts can be found in ``pytest`` directory. To list available
26 scenarios with described procedures, one can use a pytest command:
28 .. code-block:: console
[all …]
/Zephyr-latest/tests/subsys/logging/dictionary/
Dtestcase.yaml2 # For twister runs, only logging backends with in hexidecimal format
6 - mps2/an385
7 - qemu_cortex_a53
8 - qemu_riscv32
9 - qemu_riscv64
10 - qemu_x86
11 - qemu_x86_64
13 - qemu_x86
14 - qemu_x86_64
18 harness: pytest
[all …]
/Zephyr-latest/scripts/tests/twister_blackbox/test_data/tests/pytest/
Dtest_data.yaml2 sample.twister.pytest:
4 - native_sim
5 harness: pytest
7 pytest_args: ["--custom-pytest-arg", "foo", "--cmdopt", "."]
9 - test_framework
10 - pytest
12 - native_sim
/Zephyr-latest/samples/subsys/testsuite/pytest/basic/
Dtestcase.yaml2 sample.twister.pytest:
4 - native_sim
5 harness: pytest
7 pytest_args: ["--custom-pytest-arg", "foo", "--cmdopt", "."]
9 - test_framework
10 - pytest
12 - native_sim
/Zephyr-latest/tests/subsys/debug/gdbstub/
Dtestcase.yaml4 # SPDX-License-Identifier: Apache-2.0
9 - debug
10 - gdbstub
14 # Basic build-only test for all platforms supporting gdbstub
17 - qemu_x86
18 - qemu_cortex_a9
24 - qemu_x86
25 harness: pytest
28 - "pytest/test_gdbstub.py"
30 - "--gdb_timeout"
[all …]
/Zephyr-latest/scripts/pylib/pytest-twister-harness/src/twister_harness/
Dplugin.py3 # SPDX-License-Identifier: Apache-2.0
10 import pytest
21 def pytest_addoption(parser: pytest.Parser):
22 twister_harness_group = parser.getgroup('Twister harness')
24 '--twister-harness',
27 help='Activate Twister harness plugin.'
31 'Activate Twister harness plugin',
35 '--base-timeout',
42 '--flash-timeout',
48 '--build-dir',
[all …]
Dtwister_harness_config.py3 # SPDX-License-Identifier: Apache-2.0
12 import pytest
51 """Store Twister harness configuration to have easy access in test."""
55 def create(cls, config: pytest.Config) -> TwisterHarnessConfig:
56 """Create new instance from pytest.Config."""
95 def _cast_to_path(path: str | None) -> Path | None:
/Zephyr-latest/samples/subsys/testsuite/pytest/shell/
DREADME.rst1 .. zephyr:code-sample:: pytest_shell
2 :name: Pytest shell application testing
4 Execute pytest tests against the Zephyr shell.
9 The sample project illustrates usage of pytest framework integrated with
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
14 ``pytest/test_shell.py`` file. The first test verifies valid response for
17 is defined in ``pytest-twister-harness`` plugin. More information about plugin
28 Build and run sample by Twister:
[all …]
/Zephyr-latest/doc/
Drequirements.txt5 sphinx-tabs
6 sphinxcontrib-svg2pdfconverter
8 sphinx-notfound-page
9 sphinx-copybutton
10 sphinx-togglebutton
11 sphinx-sitemap
12 sphinx-autobuild
18 # Used by pytest-twister-harness plugin (imported by autodoc)
19 pytest
/Zephyr-latest/scripts/tests/twister/
Dtest_testinstance.py4 # SPDX-License-Identifier: Apache-2.0
5 # pylint: disable=line-too-long
13 import pytest
17 sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
19 from pylib.twister.twisterlib.platform import Simulator
37 @pytest.mark.parametrize(
38 "build_only, slow, harness, platform_type, platform_sim, device_testing,fixture, expected",
47 harness, argument
59 testsuite = class_testplan.testsuites.get('scripts/tests/twister/test_data/testsuites/tests/'
67 testsuite.harness = harness
[all …]
Dtest_environment.py5 # SPDX-License-Identifier: Apache-2.0
12 import pytest
25 ['--short-build-path', '-k'],
26 '--short-build-path requires Ninja to be enabled'
32 ['--device-serial-pty', 'dummy'],
33 '--device-serial-pty is not supported on Windows OS'
39 ['--west-runner=dummy'],
40 'west-runner requires west-flash to be enabled'
46 ['--west-flash=\"--board-id=dummy\"'],
47 'west-flash requires device-testing to be enabled'
[all …]
Dtest_config_parser.py5 # SPDX-License-Identifier: Apache-2.0
11 import pytest
56 - '--CONF_FILE=file1.conf'
57 - '--OVERLAY_CONFIG=config1.conf'
64 os.path.join(zephyr_base, 'scripts', 'schemas','twister', 'testsuite-schema.yaml')
75 … assert scenario_data['extra_args'] == ['--CONF_FILE=file1.conf', '--OVERLAY_CONFIG=config1.conf']
90 os.path.join(zephyr_base, 'scripts', 'schemas', 'twister','testsuite-schema.yaml')
127 'harness': 'test',
134 @pytest.mark.parametrize(
140 ('True', 'bool', 'True', None), # do-nothing cast
[all …]
Dtest_testsuite.py4 # SPDX-License-Identifier: Apache-2.0
12 import pytest
18 sys.path.insert(0, os.path.join(ZEPHYR_BASE, 'scripts', 'pylib', 'twister'))
86 @pytest.mark.parametrize(
194 @pytest.mark.parametrize(
248 @pytest.mark.parametrize(
294 @pytest.mark.parametrize(
304 with pytest.raises(TwisterException):
312 'twister',
368 @pytest.mark.parametrize(
[all …]
Dtest_harness.py4 # SPDX-License-Identifier: Apache-2.0
7 This test file contains testsuites for the Harness classes of twister
12 import pytest
19 sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
21 from twisterlib.harness import (
25 Harness,
27 Pytest,
48 …+ "[{state}] {suite}.{test}, where GetParam() = 8-byte object <0B-00 00-00 00-9A 80-F7> (0 ms tota…
54 "[00:00:00.000,000] <inf> label: [----------] Global test environment tear-down"
58 def process_logs(harness, logs): argument
[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/
Dharness.py1 # SPDX-License-Identifier: Apache-2.0
19 from pytest import ExitCode
28 logger = logging.getLogger('twister')
34 class Harness: class
71 def trace(self) -> bool:
75 def status(self) -> TwisterStatus:
79 def status(self, value : TwisterStatus) -> None:
113 def translate_record(self, record: dict) -> dict:
121 logger.warning(f"HARNESS:{self.__class__.__name__}: recording JSON failed:"
123 # Don't set the Harness state to failed for recordings.
[all …]
/Zephyr-latest/scripts/tests/twister/pytest_integration/
Dtest_harness_pytest.py2 # SPDX-License-Identifier: Apache-2.0
5 import pytest
11 from twisterlib.harness import Pytest
17 @pytest.fixture
18 def testinstance() -> TestInstance:
36 @pytest.mark.parametrize('device_type', ['native', 'qemu'])
38 pytest_harness = Pytest()
43 'pytest',
44 'samples/hello/pytest',
45 f'--build-dir={testinstance.build_dir}',
[all …]

12