Metadata-Version: 2.4
Name: pytest-embedded-jtag
Version: 2.10.0
Summary: Make pytest-embedded plugin work with JTAG.
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-serial~=2.10.0
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

### pytest-embedded-jtag

A `pytest-embedded` service for hardware debugging via OpenOCD and GDB.

#### Service Activation

Activate this service by passing `jtag` to `--embedded-services`:

```shell
pytest --embedded-services serial,jtag --app-path /path/to/app
```

#### Extra Functionalities

- **`openocd` Fixture**: Launches and manages an OpenOCD background process. Supports sending commands over the OpenOCD Telnet port.
- **`gdb` Fixture**: Launches and manages a GDB process connected to the target debugger.
- **Output Duplication**: Duplicates both OpenOCD and GDB output streams into `dut.pexpect_proc` for unified log matching.

#### CLI Options

- `--openocd-prog-path`: Path to the OpenOCD executable. Default: `"openocd"`.
- `--openocd-cli-args`: Arguments passed to OpenOCD. Default: `"-f board/esp32-wrover-kit-3.3v.cfg"`.
- `--gdb-prog-path`: Path to the architecture-specific GDB executable. Default: `"xtensa-esp32-elf-gdb"`.
- `--gdb-cli-args`: Arguments passed to GDB. Default: `"--quiet"`.
- `--no-gdb`: Set to `True` to skip creating the GDB instance when only OpenOCD is needed. Default: `False`.

#### Quick Example

```python
from pytest_embedded import Dut
from pytest_embedded_jtag import Gdb, OpenOcd


def test_jtag_debugging(dut: Dut, openocd: OpenOcd, gdb: Gdb):
    gdb.write('target remote :3333')
    gdb.expect('Remote debugging using :3333')
    gdb.write('monitor reset halt')
    dut.expect('Target halted')
```

