Run QEMU test using Docker. Args: firmware_path: Path to firmware or build directory timeout: Test timeout in seconds interrupt_regex: Pattern to interrupt on success machine: QEMU machine type (esp32, esp32c3, esp32s3) Returns:
(
self,
firmware_path: str | Path,
timeout: int = 30,
interrupt_regex: Optional[str] = None,
machine: str = "esp32",
)
| 47 | return "none" |
| 48 | |
| 49 | def run_qemu_test( |
| 50 | self, |
| 51 | firmware_path: str | Path, |
| 52 | timeout: int = 30, |
| 53 | interrupt_regex: Optional[str] = None, |
| 54 | machine: str = "esp32", |
| 55 | ) -> int: |
| 56 | """Run QEMU test using Docker. |
| 57 | |
| 58 | Args: |
| 59 | firmware_path: Path to firmware or build directory |
| 60 | timeout: Test timeout in seconds |
| 61 | interrupt_regex: Pattern to interrupt on success |
| 62 | machine: QEMU machine type (esp32, esp32c3, esp32s3) |
| 63 | |
| 64 | Returns: |
| 65 | Exit code (0 for success) |
| 66 | """ |
| 67 | firmware_path = Path(firmware_path) |
| 68 | |
| 69 | runner_type = self.select_runner() |
| 70 | print(f"Selected QEMU runner: {runner_type}") |
| 71 | |
| 72 | if runner_type == "docker": |
| 73 | return self._run_docker_qemu( |
| 74 | firmware_path, timeout, interrupt_regex, machine |
| 75 | ) |
| 76 | else: |
| 77 | print("ERROR: Docker is not available!", file=sys.stderr) |
| 78 | print("Please install Docker to run QEMU tests", file=sys.stderr) |
| 79 | return 1 |
| 80 | |
| 81 | def _run_docker_qemu( |
| 82 | self, |
no test coverage detected