Lines Matching +full:pytest +full:- +full:twister +full:- +full:harness

4 # 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
60 harness.handle(line)
118 @pytest.mark.parametrize(
137 harness = Harness()
138 harness.record = {"regex": pattern}
139 harness.record_pattern = re.compile(pattern)
141 harness.record_as_json = as_json
143 harness.record["as_json"] = as_json
145 assert not harness.recording
148 harness.parse_record(line)
150 assert harness.recording == expected_records
164 @pytest.mark.parametrize(
179 harness = Harness()
180 harness.run_id = 12345
181 harness.status = TwisterStatus.NONE
182 harness.fault = fault
183 harness.fail_on_fault = fail_on_fault
184 mock.patch.object(Harness, "parse_record", return_value=None)
187 harness.process_test(line)
190 assert harness.matched_run_id == exp_id
191 assert harness.status == exp_stat
192 assert harness.capture_coverage == cap_cov
193 assert harness.recording == []
265 @pytest.mark.parametrize(
328 @pytest.mark.parametrize(
378 @pytest.mark.parametrize(
439 with pytest.raises(Exception):
449 @pytest.mark.parametrize(
479 hardware.runner_params = ["--runner-param1", "runner-param2"]
491 pytest_test = Pytest()
503 with pytest.raises(PytestHarnessException) as exinfo:
507 assert "--device-type=hardware" in command
509 assert "--device-serial-pty=serial_pty" in command
511 assert "--device-serial=serial" in command
512 assert "--device-serial-baud=115200" in command
513 assert "--runner=runner" in command
514 assert "--runner-params=--runner-param1" in command
515 assert "--runner-params=runner-param2" in command
516 assert "--west-flash-extra-args=args" in command
517 assert "--device-id=123" in command
518 assert "--device-product=product" in command
519 assert "--pre-script=pre_script" in command
520 assert "--post-flash-script=post_flash_script" in command
521 assert "--post-script=post_script" in command
522 assert "--twister-fixture=fixture1:option1" in command
523 assert "--twister-fixture=fixture2" in command
528 pytest_test = Pytest()
529 mock.patch.object(Pytest, "PYTEST_PLUGIN_INSTALLED", False)
535 assert result_cmd == ["cmd", "-p", "twister_harness.plugin"]
544 harness = Pytest()
545 harness = mock.create_autospec(harness)
547 mock.patch.object(Pytest, "generate_command", return_value=cmd)
548 mock.patch.object(Pytest, "run_command")
570 test_obj = Pytest()
583 @pytest.mark.parametrize("name", TEST_DATA_6, ids=["no name", "provided name"])
611 "START - test_testcase",
622 "PASS - test_example in 0 seconds",
633 "SKIP - test_example in 0 seconds",
644 "FAIL - test_example in 0 seconds",
655 "START - test_testcase",
666 "START - test_testcase",
677 "START - test_testcase",
688 @pytest.mark.parametrize(
740 @pytest.fixture
758 harness = Gtest()
759 harness.configure(instance)
760 return harness
1045 with pytest.raises(
1064 with pytest.raises(
1083 with pytest.raises(
1108 with pytest.raises(
1137 harness = Bsim()
1138 harness.instance = mocked_instance
1147 harness.build()