refactor(console/advanced): Merge console advanced and advanced_usb_cdc examples

- removed examples/system/console/advanced_usb_cdc
    - refactor resulting console/advanced example
    - enabled advanced console for all peripherals (UART, USB_OTG, USB_JTAG)
    - added pytest to check UART console output
    - update docs
This commit is contained in:
Peter Marcisovsky
2024-04-05 12:30:17 +02:00
parent 997512ace2
commit 82a4c12817
20 changed files with 352 additions and 524 deletions

View File

@@ -1,5 +1,6 @@
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
from time import sleep
import pytest
from pytest_embedded import Dut
@@ -8,12 +9,16 @@ from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32c3
@pytest.mark.generic
@pytest.mark.parametrize('config', [
'history',
'nohistory',
], indirect=True)
def test_console_advanced(config: str, dut: Dut) -> None:
if config == 'history':
dut.expect('Command history enabled')
elif config == 'nohistory':
dut.expect('Command history disabled')
def test_console_advanced(dut: Dut) -> None:
sleep(2) # Some time for the OS to enumerate our USB device
# Wait until the console prompt appears
dut.expect(dut.target + '> ')
# Write CLI command "version"
dut.write('version')
sleep(0.5)
# Check if following strings are present in the "version" command output
dut.expect('IDF Version')
dut.expect('Chip info')