Skip to content

Commit

Permalink
Merge pull request #319 from espressif/fix/optional_dependency_nuttx
Browse files Browse the repository at this point in the history
Fix/optional dependency nuttx
  • Loading branch information
hfudev authored Nov 13, 2024
2 parents 8e742dd + fe7f800 commit 3f53777
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
18 changes: 7 additions & 11 deletions pytest-embedded-nuttx/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
### pytest-embedded-nuttx

Pytest embedded service for NuttX project. alongside Espressif devices.
Pytest embedded service for the NuttX project, compatible with Espressif devices.

Using the 'nuttx' service alongside 'serial' allows writing and reading from
the serial port, taking the NuttShell into consideration when running programs
and even getting return codes.
Using the 'nuttx' service alongside 'serial' enables reading from and writing to the serial port, taking NuttShell into account when running programs and retrieving return codes.

While using pytest-embedded-nuttx allows you to communicate with serial
devices and run simple tests, enabling the 'esp' service adds extra capabilities for
Espressif devices, such as flashing and device rebooting.
The `nuttx` service provides basic serial communication and testing. Adding the 'esp' service enables further capabilities for Espressif devices, including flashing and device rebooting.

Extra Functionalities:
Additional Features:

- `app`: Explore the NuttX binary directory and identify firmware and bootloader files.
- `serial`: Parse the binary information and flash the board. Requires 'esp' service.
- `dut`: Send commands to device through serial port. Requires 'serial' service or 'esp' for Espressif devices.
- `app`: Scans the NuttX binary directory to locate firmware and bootloader files.
- `serial`: Parses binary information and flashes the board. Requires the 'esp' service.
- `dut`: Sends commands to the device through the serial port. Requires the 'serial' service or 'esp' service for Espressif devices.
1 change: 0 additions & 1 deletion pytest-embedded-nuttx/pytest_embedded_nuttx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from pytest_embedded.utils import lazy_load

from .app import NuttxApp
from .dut import NuttxDut, NuttxEspDut

__getattr__ = lazy_load(
Expand Down
7 changes: 4 additions & 3 deletions pytest-embedded-nuttx/pytest_embedded_nuttx/dut.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import logging
import re
from time import sleep
from typing import AnyStr
from typing import TYPE_CHECKING, AnyStr

import pexpect
from pytest_embedded_serial.dut import SerialDut

from .app import NuttxApp
if TYPE_CHECKING:
from .app import NuttxApp


class NuttxDut(SerialDut):
Expand Down Expand Up @@ -83,7 +84,7 @@ class NuttxEspDut(NuttxDut):

def __init__(
self,
app: NuttxApp,
app: 'NuttxApp',
**kwargs,
) -> None:
self.target = app.target
Expand Down
1 change: 1 addition & 0 deletions pytest-embedded/pytest_embedded/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def pytest_addoption(parser):
'- qemu: use qemu simulator instead of the real target\n'
'- arduino: auto-detect more app info with arduino specific rules, auto flash-in\n'
'- wokwi: use wokwi simulator instead of the real target\n'
'- nuttx: service for nuttx project, optionally with espressif devices\n'
'All the related CLI options are under the groups named by "embedded-<service>"',
)
base_group.addoption('--app-path', help='App path')
Expand Down

0 comments on commit 3f53777

Please sign in to comment.