From e9408969081a22254f8d33ee8276f1cd6e69f5d3 Mon Sep 17 00:00:00 2001 From: gaoxu Date: Fri, 26 Jun 2026 16:16:07 +0800 Subject: [PATCH] ci(adc): remove ADC runner and move ADC tests to generic --- .../test_apps/legacy_adc_driver/main/test_legacy_adc.c | 4 ++-- .../test_apps/legacy_adc_driver/pytest_legacy_adc.py | 7 +++---- components/esp_adc/test_apps/adc/main/test_common_adc.h | 4 ++-- components/esp_adc/test_apps/adc/pytest_adc.py | 9 ++++----- .../adc/continuous_read/pytest_adc_continuous.py | 3 +-- .../peripherals/adc/oneshot_read/pytest_adc_oneshot.py | 7 +++---- .../dac/dac_cosine_wave/pytest_dac_cosine_wave.py | 7 +++---- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c b/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c index a34adcffadb..2d0b86cc591 100644 --- a/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c +++ b/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c @@ -27,7 +27,7 @@ #elif CONFIG_IDF_TARGET_ESP32S2 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 35 +#define ADC_TEST_LOW_THRESH 40 #define ADC_TEST_HIGH_VAL 8191 #define ADC_TEST_HIGH_THRESH 10 @@ -48,7 +48,7 @@ #elif CONFIG_IDF_TARGET_ESP32C2 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 15 +#define ADC_TEST_LOW_THRESH 30 #define ADC_TEST_HIGH_VAL 3400 #define ADC_TEST_HIGH_THRESH 200 diff --git a/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py b/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py index 6bc3b838d66..c9112105878 100644 --- a/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py +++ b/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py @@ -1,6 +1,5 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded import Dut @@ -11,7 +10,7 @@ from pytest_embedded import Dut @pytest.mark.esp32c3 @pytest.mark.esp32c6 @pytest.mark.esp32h2 -@pytest.mark.adc +@pytest.mark.generic @pytest.mark.parametrize( 'config', [ @@ -24,7 +23,7 @@ def test_legacy_adc(dut: Dut) -> None: @pytest.mark.esp32c2 -@pytest.mark.adc +@pytest.mark.generic @pytest.mark.xtal_26mhz @pytest.mark.parametrize( 'config, baud', diff --git a/components/esp_adc/test_apps/adc/main/test_common_adc.h b/components/esp_adc/test_apps/adc/main/test_common_adc.h index 5228713af93..542b3491d9b 100644 --- a/components/esp_adc/test_apps/adc/main/test_common_adc.h +++ b/components/esp_adc/test_apps/adc/main/test_common_adc.h @@ -42,7 +42,7 @@ extern "C" { #elif CONFIG_IDF_TARGET_ESP32S2 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 35 +#define ADC_TEST_LOW_THRESH 85 #define ADC_TEST_HIGH_VAL 8191 #define ADC_TEST_HIGH_VAL_DMA 4095 @@ -66,7 +66,7 @@ extern "C" { #elif CONFIG_IDF_TARGET_ESP32C2 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 15 +#define ADC_TEST_LOW_THRESH 30 #define ADC_TEST_HIGH_VAL 3400 #define ADC_TEST_HIGH_THRESH 200 diff --git a/components/esp_adc/test_apps/adc/pytest_adc.py b/components/esp_adc/test_apps/adc/pytest_adc.py index fa7c737a4d9..9784bf2b2b9 100644 --- a/components/esp_adc/test_apps/adc/pytest_adc.py +++ b/components/esp_adc/test_apps/adc/pytest_adc.py @@ -1,6 +1,5 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded import Dut @@ -11,7 +10,7 @@ from pytest_embedded import Dut @pytest.mark.esp32c3 @pytest.mark.esp32c6 @pytest.mark.esp32h2 -@pytest.mark.adc +@pytest.mark.generic @pytest.mark.parametrize('config', [ 'iram_safe', 'release', @@ -22,8 +21,8 @@ def test_adc(dut: Dut) -> None: # No PM test, as C2 doesn't support ADC continuous mode +@pytest.mark.generic @pytest.mark.esp32c2 -@pytest.mark.adc @pytest.mark.xtal_26mhz @pytest.mark.parametrize( 'config, baud', @@ -41,7 +40,7 @@ def test_adc_esp32c2_xtal_26mhz(dut: Dut) -> None: @pytest.mark.esp32c3 @pytest.mark.esp32c6 @pytest.mark.esp32h2 -@pytest.mark.adc +@pytest.mark.generic @pytest.mark.parametrize('config', [ 'gdma_iram_safe', ], indirect=True) diff --git a/examples/peripherals/adc/continuous_read/pytest_adc_continuous.py b/examples/peripherals/adc/continuous_read/pytest_adc_continuous.py index 7c820be545e..de2509f300c 100644 --- a/examples/peripherals/adc/continuous_read/pytest_adc_continuous.py +++ b/examples/peripherals/adc/continuous_read/pytest_adc_continuous.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded.dut import Dut @@ -11,7 +10,7 @@ from pytest_embedded.dut import Dut @pytest.mark.esp32c3 @pytest.mark.esp32c6 @pytest.mark.esp32h2 -@pytest.mark.adc +@pytest.mark.generic def test_adc_continuous(dut: Dut) -> None: res = dut.expect(r'TASK: ret is 0, ret_num is (\d+) bytes') num = res.group(1).decode('utf8') diff --git a/examples/peripherals/adc/oneshot_read/pytest_adc_oneshot.py b/examples/peripherals/adc/oneshot_read/pytest_adc_oneshot.py index 9d5ad5058ac..db8df8d691f 100644 --- a/examples/peripherals/adc/oneshot_read/pytest_adc_oneshot.py +++ b/examples/peripherals/adc/oneshot_read/pytest_adc_oneshot.py @@ -1,6 +1,5 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded.dut import Dut @@ -11,13 +10,13 @@ from pytest_embedded.dut import Dut @pytest.mark.esp32c3 @pytest.mark.esp32c6 @pytest.mark.esp32h2 -@pytest.mark.adc +@pytest.mark.generic def test_adc_oneshot(dut: Dut) -> None: dut.expect(r'EXAMPLE: ADC1 Channel\[(\d+)\] Raw Data: (\d+)', timeout=5) @pytest.mark.esp32c2 -@pytest.mark.adc +@pytest.mark.generic @pytest.mark.xtal_26mhz @pytest.mark.parametrize( 'config, baud', diff --git a/examples/peripherals/dac/dac_cosine_wave/pytest_dac_cosine_wave.py b/examples/peripherals/dac/dac_cosine_wave/pytest_dac_cosine_wave.py index 22d432d12bf..367a31ce6c6 100644 --- a/examples/peripherals/dac/dac_cosine_wave/pytest_dac_cosine_wave.py +++ b/examples/peripherals/dac/dac_cosine_wave/pytest_dac_cosine_wave.py @@ -1,12 +1,11 @@ -# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded import Dut @pytest.mark.esp32 -@pytest.mark.adc +@pytest.mark.generic def test_dac_cosine_wave_example_with_12bit_adc(dut: Dut) -> None: res = [] for _ in range(30): @@ -20,7 +19,7 @@ def test_dac_cosine_wave_example_with_12bit_adc(dut: Dut) -> None: @pytest.mark.esp32s2 -@pytest.mark.adc +@pytest.mark.generic def test_dac_cosine_wave_example_with_13bit_adc(dut: Dut) -> None: res = [] for _ in range(30):