feat(esp_driver_uart): add ci test for hp uart wakeup modes

This commit is contained in:
Li Shuai
2025-03-26 12:20:15 +08:00
parent d115a3daac
commit bcd138f89d
3 changed files with 459 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded_idf import CaseTester
from pytest_embedded_idf.utils import idf_parametrize
input_argv = {
@@ -36,7 +37,7 @@ def test_uart_single_dev(case_tester) -> None: # type: ignore
assert uart_ports, f"Error: Chip type '{chip_type}' is not defined in input_argv. Aborting..."
for case in case_tester.test_menu:
if 'hp-uart-only' not in case.groups:
if 'hp-uart-only' not in case.groups and 'wakeup' not in case.groups:
for uart_port in uart_ports:
dut.serial.hard_reset()
dut._get_ready()
@@ -45,7 +46,7 @@ def test_uart_single_dev(case_tester) -> None: # type: ignore
dut.expect("select to test 'uart' or 'lp_uart' port", timeout=10)
dut.write(f'{uart_port}')
dut.expect_unity_test_output()
else:
elif 'wakeup' not in case.groups:
dut._run_normal_case(case, reset=True)
@@ -62,10 +63,30 @@ def test_uart_single_dev(case_tester) -> None: # type: ignore
def test_uart_single_dev_psram(case_tester) -> None: # type: ignore
dut = case_tester.first_dut
for case in case_tester.test_menu:
dut.serial.hard_reset()
dut._get_ready()
dut.confirm_write(case.index, expect_str=f'Running {case.name}...')
if 'wakeup' not in case.groups:
dut.serial.hard_reset()
dut._get_ready()
dut.confirm_write(case.index, expect_str=f'Running {case.name}...')
dut.expect("select to test 'uart' or 'lp_uart' port", timeout=10)
dut.write('uart')
dut.expect_unity_test_output()
dut.expect("select to test 'uart' or 'lp_uart' port", timeout=10)
dut.write('uart')
dut.expect_unity_test_output()
# ESP32 only supports uart wakeup if signal routes through IOMUX, ESP32S3 multi device runner has no psram IDF-12837,
# ESP32C61 lack of runner IDF-10949, ESP32P4 not yet supported IDF-12839.
@pytest.mark.temp_skip_ci(targets=['esp32', 'esp32s3', 'esp32c61', 'esp32p4'], reason='no multi-dev runner')
@pytest.mark.generic_multi_device
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
@pytest.mark.parametrize(
'config',
[
'release',
],
indirect=True,
)
@pytest.mark.parametrize('count', [2], indirect=True)
def test_hp_uart_wakeup_modes(case_tester: CaseTester) -> None:
relevant_cases = [case for case in case_tester.test_menu if {'wakeup', 'uart'}.issubset(case.groups)]
for case in relevant_cases:
case_tester.run_multi_dev_case(case=case, reset=True)