Metadata-Version: 2.4
Name: pytest-embedded-qemu
Version: 2.10.0
Summary: Make pytest-embedded plugin work with QEMU.
Author-email: Fu Hanxi <fuhanxi@espressif.com>
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Testing
License-File: LICENSE
Requires-Dist: pytest-embedded~=2.10.0
Requires-Dist: qemu.qmp==0.0.3
Requires-Dist: pytest-embedded-idf~=2.10.0 ; extra == "idf"
Project-URL: changelog, https://github.com/espressif/pytest-embedded/blob/main/CHANGELOG.md
Project-URL: documentation, https://docs.espressif.com/projects/pytest-embedded/en/latest/
Project-URL: homepage, https://github.com/espressif/pytest-embedded
Project-URL: repository, https://github.com/espressif/pytest-embedded
Provides-Extra: idf

### pytest-embedded-qemu

A `pytest-embedded` service for executing test cases in a [QEMU](https://www.qemu.org/) virtual machine without physical hardware.

#### Service Activation

Activate this service by passing `qemu` to `--embedded-services`. Typically paired with `idf`:

```shell
pytest --embedded-services idf,qemu --app-path /path/to/app
```

#### Extra Functionalities

- **Automatic Image Generation**: When used with `idf`, automatically merges binaries (bootloader, partition table, and app) into a single bootable QEMU flash image.
- **`qemu` Fixture**: Launches and supervises the QEMU process.
- **Flash Encryption Simulation**: Supports pre-encrypted flash images using a specified key file.
- **eFuse Support**: Allows specifying virtual eFuse states for chip feature simulation.

#### CLI Options

- `--qemu-image-path`: Path to the QEMU flash image binary. Default: `<app_path>/flash_image.bin`.
- `--qemu-prog-path`: Path to the QEMU executable. Default: `"qemu-system-xtensa"`.
- `--qemu-cli-args`: Base CLI options for QEMU. Default: `"-nographic -machine esp32"`.
- `--qemu-extra-args`: Extra arguments appended to the QEMU command line. Default: `None`.
- `--qemu-efuse-path`: Path to an eFuse file to simulate burn-in values. Default: `None`.
- `--skip-regenerate-image`: Skip recreating the flash image if one is already present. Default: `False`.
- `--encrypt`: Enable pre-encryption flash simulation workflow. Default: `False`.
- `--keyfile`: Path to the encryption key file for the pre-encrypted workflow. Default: `None`.

#### Quick Example

```python
from pytest_embedded import Dut


def test_qemu_execution(dut: Dut):
    # Runs entirely in QEMU software emulation
    dut.expect('Booting ESP-IDF app...')
    dut.expect('Hello world!')
```

