test(lp_core): use soc_filtered_targets for all LP core pytest parametrization

Several LP core pytest files were either hardcoded to specific chip lists
or using a less-precise SOC capability filter:

- test_lp_core_multi_device: was locked to ['esp32c6'] pending a workaround
  for LP I2C on esp32p4; all three active LP core chips now have
  SOC_LP_I2C_SUPPORTED=1, so switch to soc_filtered_targets.

- test_lp_uart_wakeup_modes: was using SOC_LP_CORE_SUPPORTED which is
  semantically wrong for a UART test; change to SOC_ULP_LP_UART_SUPPORTED.

- LP core example pytests (build_system, interrupt, gpio_intr_pulse_counter,
  lp_timer_interrupt): replace hardcoded ['esp32c5', 'esp32c6', 'esp32p4']
  with soc_filtered_targets('SOC_LP_CORE_SUPPORTED == 1') so that new
  chips automatically get coverage when their SOC cap is enabled.

Made-with: Cursor
This commit is contained in:
Sudeep Mohanty
2026-04-28 15:30:47 +02:00
parent b8d99436a5
commit bf6a44f5d1
4 changed files with 23 additions and 10 deletions
@@ -2,7 +2,9 @@
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
import pytest import pytest
from pytest_embedded import Dut from pytest_embedded import Dut
from pytest_embedded_idf import CaseTester
from pytest_embedded_idf.utils import idf_parametrize from pytest_embedded_idf.utils import idf_parametrize
from pytest_embedded_idf.utils import soc_filtered_targets
@pytest.mark.generic @pytest.mark.generic
@@ -44,10 +46,16 @@ def test_lp_vad(dut: Dut) -> None:
dut.run_all_single_board_cases(group='lp_vad') dut.run_all_single_board_cases(group='lp_vad')
# TODO: Enable LP I2C test for esp32p4 (IDF-9407)
@pytest.mark.generic_multi_device @pytest.mark.generic_multi_device
@pytest.mark.parametrize('count', [2], indirect=True) @pytest.mark.parametrize('count', [2], indirect=True)
@idf_parametrize('target', ['esp32c6'], indirect=['target']) @pytest.mark.parametrize(
'config',
[
'defaults',
],
indirect=True,
)
@idf_parametrize('target', soc_filtered_targets('SOC_LP_I2C_SUPPORTED == 1'), indirect=['target'])
def test_lp_core_multi_device(case_tester: CaseTester) -> None: def test_lp_core_multi_device(case_tester: CaseTester) -> None:
# Run only non-UART multi-device cases (e.g. LP I2C); LP UART is covered # Run only non-UART multi-device cases (e.g. LP I2C); LP UART is covered
# by test_lp_uart_multi_device which targets all LP_CORE_SUPPORTED chips. # by test_lp_uart_multi_device which targets all LP_CORE_SUPPORTED chips.
@@ -75,11 +83,7 @@ def test_lp_uart_multi_device(case_tester: CaseTester) -> None:
@pytest.mark.generic_multi_device @pytest.mark.generic_multi_device
@pytest.mark.parametrize( @pytest.mark.parametrize(
'target', 'target',
[ soc_filtered_targets('SOC_ULP_LP_UART_SUPPORTED == 1'),
'esp32c5',
'esp32c6',
'esp32p4',
],
indirect=True, indirect=True,
) )
@pytest.mark.parametrize( @pytest.mark.parametrize(
@@ -3,9 +3,10 @@
import pytest import pytest
from pytest_embedded_idf.dut import IdfDut from pytest_embedded_idf.dut import IdfDut
from pytest_embedded_idf.utils import idf_parametrize from pytest_embedded_idf.utils import idf_parametrize
from pytest_embedded_idf.utils import soc_filtered_targets
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', ['esp32c5', 'esp32c6', 'esp32p4'], indirect=['target']) @idf_parametrize('target', soc_filtered_targets('SOC_LP_CORE_SUPPORTED == 1'), indirect=['target'])
def test_lp_core_build_sys(dut: IdfDut) -> None: def test_lp_core_build_sys(dut: IdfDut) -> None:
dut.expect('Sum calculated by ULP using external library func: 11') dut.expect('Sum calculated by ULP using external library func: 11')
@@ -5,10 +5,17 @@ import logging
import pytest import pytest
from pytest_embedded import Dut from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize from pytest_embedded_idf.utils import idf_parametrize
from pytest_embedded_idf.utils import soc_filtered_targets
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', ['esp32c6', 'esp32p4'], indirect=['target']) @idf_parametrize(
'target',
soc_filtered_targets(
'SOC_LP_CORE_SUPPORTED == 1 and SOC_ULP_LP_UART_SUPPORTED == 1 and SOC_DEEP_SLEEP_SUPPORTED == 1'
),
indirect=['target'],
)
def test_lp_core_pcnt(dut: Dut) -> None: def test_lp_core_pcnt(dut: Dut) -> None:
res = dut.expect(r'ULP will wake up processor after every (\d+) pulses') res = dut.expect(r'ULP will wake up processor after every (\d+) pulses')
wakeup_limit = res.group(1).decode('utf-8') wakeup_limit = res.group(1).decode('utf-8')
@@ -3,9 +3,10 @@
import pytest import pytest
from pytest_embedded import Dut from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize from pytest_embedded_idf.utils import idf_parametrize
from pytest_embedded_idf.utils import soc_filtered_targets
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', ['esp32c5', 'esp32c6', 'esp32p4'], indirect=['target']) @idf_parametrize('target', soc_filtered_targets('SOC_LP_CORE_SUPPORTED == 1'), indirect=['target'])
def test_lp_core_intr(dut: Dut) -> None: def test_lp_core_intr(dut: Dut) -> None:
dut.expect('Triggered 10 interrupts on the LP-Core, LP-Core received 10 interrupts') dut.expect('Triggered 10 interrupts on the LP-Core, LP-Core received 10 interrupts')