Lines Matching +full:pylib +full:- +full:tests

1 # SPDX-License-Identifier: Apache-2.0
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:
127 def parse_record(self, line) -> re.Match:
218 self.instance.execution_time = time.time() - start_time
222 # all tests in one Robot file are treated as a single test case,
387 '--twister-harness',
388 '-s', '-v',
389 f'--build-dir={self.running_dir}',
390 f'--junit-xml={self.report_file}',
391 '--log-file-level=DEBUG',
392 '--log-file-format=%(asctime)s.%(msecs)03d:%(levelname)s:%(name)s: %(message)s',
393 f'--log-file={self.pytest_log_file_path}',
394 f'--platform={self.instance.platform.name}'
400 command.append(f'--dut-scope={pytest_dut_scope}')
404 '--log-cli-level=DEBUG',
405 '--log-cli-format=%(levelname)s: %(message)s'
410 command.append(f'--base-timeout={base_timeout}')
417 command.append(f'--device-type={handler.type_str}')
419 command.append('--device-type=custom')
427 command.append(f'--twister-fixture={fixture}')
430 command.append(f'--extra-test-args={shlex.join(handler.options.extra_test_args)}')
440 command = ['--device-type=hardware']
449 command.append(f'--device-serial-pty={hardware.serial_pty}')
452 f'--device-serial={hardware.serial}',
453 f'--device-serial-baud={hardware.baud}'
457 command.append(f'--flash-timeout={hardware.flash_timeout}')
461 command.append(f'--runner={runner}')
465 command.append(f'--runner-params={param}')
468 command.append(f'--west-flash-extra-args={options.west_flash}')
471 command.append(f'--device-id={board_id}')
474 command.append(f'--device-product={hardware.product}')
477 command.append(f'--pre-script={hardware.pre_script}')
480 command.append(f'--post-flash-script={hardware.post_flash_script}')
483 command.append(f'--post-script={hardware.post_script}')
486 command.append(f'--flash-before={hardware.flash_before}')
489 command.append(f'--twister-fixture={fixture}')
518 self.instance.reason = f'Pytest error - return code {proc.returncode}'
527 pytest by update PYTHONPATH and append -p argument to pytest command.
531 cmd.extend(['-p', 'twister_harness.plugin'])
535 'pylib',
536 'pytest-twister-harness',
590 f"{elem_ts.get('failures')}/{elem_ts.get('tests')} pytest scenario(s) failed"
595 elif elem_ts.get('skipped') == elem_ts.get('tests'):
618 self.instance.reason = 'No tests collected'
622 ANSI_ESCAPE = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
623 _NAME_PATTERN = "[a-zA-Z_][a-zA-Z0-9_]*"
630 ".*(?:\\[==========\\] Done running all tests\\.|"
631 + "\\[----------\\] Global test environment tear-down)"
662 # Check that the instance doesn't exist yet (prevents re-running)
695 ), f"gTest error, mismatched tests. Expected {self.tc} but got {tc}"
734 __test__ = False # for pytest to skip this class when collects tests
740 test_case_start_pattern = re.compile(r"START - (test_)?([a-zA-Z0-9_-]+)")
742 r".*(PASS|FAIL|SKIP) - (test_)?(\S*) in (\d*[.,]?\d*) seconds"
745 r"SUITE (?P<suite_status>\S*) - .* \[(?P<suite_name>\S*)\]:"
749 r" - (PASS|FAIL|SKIP) - \[([^\.]*).(test_)?(\S*)\] duration = (\d*[.,]?\d*) seconds"
810 self.started_suites[suite_name]['count'] -= 1
813 self.started_suites[suite_name]['count'] -= 1
835 self.started_cases[tc_name]['count'] -= 1
855 # due to this tests, for example timeout. This should in this case
921 running multidevice bsim tests after twister has built them.
929 logger.warning('Cannot copy bsim exe - cannot find original executable.')
934 logger.warning('Cannot copy bsim exe - BSIM_OUT_PATH not provided.')