mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
test: format all test scripts
This commit is contained in:
@@ -2,14 +2,9 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32c2
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -18,11 +13,11 @@ from pytest_embedded import Dut
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32s2', 'esp32c2', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
def test_dma(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.octal_psram
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -31,11 +26,11 @@ def test_dma(dut: Dut) -> None:
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_dma_psram(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.flash_encryption
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -44,11 +39,11 @@ def test_dma_psram(dut: Dut) -> None:
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32p4'], indirect=['target'])
|
||||
def test_dma_ext_mem_encryption(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(reset=True)
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.flash_encryption_f4r8
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -57,5 +52,6 @@ def test_dma_ext_mem_encryption(dut: Dut) -> None:
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_dma_ext_mem_encryption_s3_f4r8(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(reset=True)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -14,5 +13,6 @@ from pytest_embedded import Dut
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32p4'], indirect=['target'])
|
||||
def test_dma2d(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
+6
-9
@@ -1,18 +1,15 @@
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
pytest.param('single_core_esp32', marks=[pytest.mark.esp32]),
|
||||
pytest.param('default', marks=[pytest.mark.supported_targets]),
|
||||
pytest.param('release', marks=[pytest.mark.supported_targets]),
|
||||
],
|
||||
indirect=True,
|
||||
@idf_parametrize(
|
||||
'config,target',
|
||||
[('single_core_esp32', 'esp32'), ('default', 'supported_targets'), ('release', 'supported_targets')],
|
||||
indirect=['config', 'target'],
|
||||
)
|
||||
def test_esp_hw_support(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -15,5 +13,6 @@ from pytest_embedded import Dut
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
def test_etm(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
@pytest.mark.linux
|
||||
@pytest.mark.host_test
|
||||
@idf_parametrize('target', ['linux'], indirect=['target'])
|
||||
def test_esp_hw_support_linux(dut: Dut) -> None:
|
||||
dut.expect_exact('Press ENTER to see the list of tests')
|
||||
dut.write('![ignore]')
|
||||
|
||||
@@ -1,39 +1,45 @@
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
from pytest_embedded_idf import IdfDut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
MSPI_F8R8_configs = [p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f8r8*')]
|
||||
MSPI_F8R8_configs = [
|
||||
p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f8r8*')
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.MSPI_F8R8
|
||||
@pytest.mark.parametrize('config', MSPI_F8R8_configs, indirect=True)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_flash8_psram8(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
# For F4R8 board (Quad Flash and Octal PSRAM)
|
||||
MSPI_F4R8_configs = [p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r8*')]
|
||||
MSPI_F4R8_configs = [
|
||||
p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r8*')
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.MSPI_F4R8
|
||||
@pytest.mark.parametrize('config', MSPI_F4R8_configs, indirect=True)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_flash4_psram8(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
# For F4R4 board (Quad Flash and Quad PSRAM)
|
||||
MSPI_F4R4_configs = [p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r4*')]
|
||||
MSPI_F4R4_configs = [
|
||||
p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r4*')
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.MSPI_F4R4
|
||||
@pytest.mark.parametrize('config', MSPI_F4R4_configs, indirect=True)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_flash4_psram4(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
@@ -1,39 +1,45 @@
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
from pytest_embedded_idf import IdfDut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
MSPI_F8R8_configs = [p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f8r8*')]
|
||||
MSPI_F8R8_configs = [
|
||||
p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f8r8*')
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.MSPI_F8R8
|
||||
@pytest.mark.parametrize('config', MSPI_F8R8_configs, indirect=True)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_flash8_psram8_with_dfs(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
# For F4R8 board (Quad Flash and Octal PSRAM)
|
||||
MSPI_F4R8_configs = [p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r8*')]
|
||||
MSPI_F4R8_configs = [
|
||||
p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r8*')
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.MSPI_F4R8
|
||||
@pytest.mark.parametrize('config', MSPI_F4R8_configs, indirect=True)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_flash4_psram8_with_dfs(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
# For F4R4 board (Quad Flash and Quad PSRAM)
|
||||
MSPI_F4R4_configs = [p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r4*')]
|
||||
MSPI_F4R4_configs = [
|
||||
p.name.replace('sdkconfig.ci.', '') for p in pathlib.Path(os.path.dirname(__file__)).glob('sdkconfig.ci.f4r4*')
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.MSPI_F4R4
|
||||
@pytest.mark.parametrize('config', MSPI_F4R4_configs, indirect=True)
|
||||
@idf_parametrize('target', ['esp32s3'], indirect=['target'])
|
||||
def test_flash4_psram4_with_dfs(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# 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
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
def deepsleep_test(dut: Dut, case_name: str) -> None:
|
||||
@@ -19,21 +19,15 @@ def deepsleep_test(dut: Dut, case_name: str) -> None:
|
||||
dut.expect(r'rst:.*\(%s\)' % reset_reason, timeout=10)
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c2
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize('target', ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c2'], indirect=['target'])
|
||||
def test_rtc_8md256_deepsleep(dut: Dut) -> None:
|
||||
deepsleep_test(dut, '"Can use 8MD256 as RTC clock source in deepsleep"')
|
||||
|
||||
|
||||
# Only targets with SOC_PM_SUPPORT_RTC_PERIPH_PD defined
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize('target', ['esp32', 'esp32s2', 'esp32s3'], indirect=['target'])
|
||||
def test_rtc_8md256_deepsleep_force_rtcperiph(dut: Dut) -> None:
|
||||
deepsleep_test(dut, '"Can use 8MD256 as RTC clock source in deepsleep (force rtc_periph)"')
|
||||
|
||||
@@ -48,18 +42,13 @@ def lightsleep_test(dut: Dut, case_name: str) -> None:
|
||||
dut.expect(r'Returned from light sleep, reason: timer', timeout=10)
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize('target', ['esp32', 'esp32s2', 'esp32s3', 'esp32c3'], indirect=['target'])
|
||||
def test_rtc_8md256_lightsleep(dut: Dut) -> None:
|
||||
lightsleep_test(dut, '"Can use 8MD256 as RTC clock source in lightsleep"')
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize('target', ['esp32', 'esp32s2', 'esp32s3'], indirect=['target'])
|
||||
def test_rtc_8md256_lightsleep_force_rtcperiph(dut: Dut) -> None:
|
||||
lightsleep_test(dut, '"Can use 8MD256 as RTC clock source in lightsleep (force rtc_periph)"')
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32
|
||||
@idf_parametrize('target', ['esp32'], indirect=['target'])
|
||||
def test_rtc_clk(dut: Dut) -> None:
|
||||
dut.expect_exact('Press ENTER to see the list of tests')
|
||||
dut.write('[rtc_clk]')
|
||||
dut.expect_unity_test_output()
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.xtal32k
|
||||
@idf_parametrize('target', ['esp32'], indirect=['target'])
|
||||
def test_rtc_xtal32k(dut: Dut) -> None:
|
||||
dut.expect_exact('Press ENTER to see the list of tests')
|
||||
dut.write('[test_env=xtal32k]')
|
||||
dut.expect_unity_test_output()
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.no32kXtal
|
||||
@idf_parametrize('target', ['esp32'], indirect=['target'])
|
||||
def test_rtc_no_xtal32k(dut: Dut) -> None:
|
||||
dut.expect_exact('Press ENTER to see the list of tests')
|
||||
dut.write('[test_env=noXtal32k]')
|
||||
@@ -32,7 +32,7 @@ def test_rtc_no_xtal32k(dut: Dut) -> None:
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2', 'esp32p4'], reason='c6/h2/p4 support TBD') # TODO: IDF-8973
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_rtc_calib(case_tester: Any) -> None:
|
||||
case_tester.run_all_multi_stage_cases()
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
from time import sleep
|
||||
from typing import Tuple
|
||||
|
||||
import pytest
|
||||
from pytest_embedded_idf.dut import IdfDut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
TEST_CONFIGS = [
|
||||
pytest.param('default'),
|
||||
@@ -71,15 +72,10 @@ available_rtcio_nums = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count', [2], indirect=True)
|
||||
@pytest.mark.parametrize('config', TEST_CONFIGS, indirect=True)
|
||||
@idf_parametrize('target', ['esp32', 'esp32s2', 'esp32s3', 'esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
def test_ext1_deepsleep(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
wakee = dut[0]
|
||||
waker = dut[1]
|
||||
@@ -127,13 +123,10 @@ def test_ext1_deepsleep(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
wakee.expect(f'io_wakeup_num = {gpio_num}', timeout=10)
|
||||
|
||||
|
||||
@pytest.mark.esp32c2
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count', [2], indirect=True)
|
||||
@pytest.mark.parametrize('config', TEST_CONFIGS, indirect=True)
|
||||
@idf_parametrize('target', ['esp32c2', 'esp32c3', 'esp32c6', 'esp32p4'], indirect=['target'])
|
||||
def test_rtcio_deepsleep(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
wakee = dut[0]
|
||||
waker = dut[1]
|
||||
@@ -176,17 +169,14 @@ def test_rtcio_deepsleep(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
wakee.expect(f'io_wakeup_num = {gpio_num}', timeout=10)
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32c2
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count', [2], indirect=True)
|
||||
@pytest.mark.parametrize('config', TEST_CONFIGS, indirect=True)
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32', 'esp32c2', 'esp32c3', 'esp32s2', 'esp32s3', 'esp32c6', 'esp32h2', 'esp32p4'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_gpio_wakeup_enable_lightsleep(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
wakee = dut[0]
|
||||
waker = dut[1]
|
||||
@@ -196,7 +186,6 @@ def test_gpio_wakeup_enable_lightsleep(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
|
||||
for wakeup_level in [1, 0]:
|
||||
for gpio_num in gpio_nums:
|
||||
|
||||
wakee.write('\r\n')
|
||||
wakee.expect('io_wakeup_test>', timeout=10)
|
||||
wakee.write(f'gpio -p {gpio_num} -l {wakeup_level}')
|
||||
|
||||
Reference in New Issue
Block a user