Lines Matching +full:bsim +full:- +full:test +full:- +full:results

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:
153 self.reason = "Fault detected while running test"
183 ''' Test cases that make use of this harness care about results given
218 self.instance.execution_time = time.time() - start_time
222 # all tests in one Robot file are treated as a single test case,
228 f"Robot test failure: {handler.sourcedir} for {self.instance.platform.name}"
246 a single test case is configured to use this harness type for simplified
319 # Reset the resulting test state to FAIL when not all of the patterns were
322 # test code, the test platform has console issues, or even some other
323 # test image was executed.
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}')
402 # Always pass output from the pytest test and the test image up to Twister log.
404 '--log-cli-level=DEBUG',
405 '--log-cli-format=%(levelname)s: %(message)s'
408 # Use the test timeout as the base timeout for pytest
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'])
536 'pytest-twister-harness',
622 ANSI_ESCAPE = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
623 _NAME_PATTERN = "[a-zA-Z_][a-zA-Z0-9_]*"
631 + "\\[----------\\] Global test environment tear-down)"
646 # Check if we started running a new test
654 # Generate the internal name of the test
657 # Assert that we don't already have a running test
662 # Check that the instance doesn't exist yet (prevents re-running)
666 # Create the test instance and set the context
673 # Check if the test run finished
685 # Check if the individual test finished
691 # Get the matching test and make sure it's the same as the current context
697 # Test finished, clear the context
700 # Update the status of the test
733 class Test(Harness): class
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"
754 """ Search a Ztest case among detected in the test image binary
755 expecting the same test names as already known from the ELF.
769 # First, try to match the test case ID to the first running Ztest suite with this test name.
810 self.started_suites[suite_name]['count'] -= 1
813 self.started_suites[suite_name]['count'] -= 1
835 self.started_cases[tc_name]['count'] -= 1
854 # Mark the test as started, if something happens here, it is mostly
862 # during test execution, however they are listed in the summary. Parse
909 tc.reason = "Test failure"
912 class Ztest(Test):
916 class Bsim(Harness): class
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.')
960 harness_class = thismodule.Test