mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
test: format all test scripts
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2025 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.supported_targets
|
||||
@pytest.mark.nightly_run
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -13,24 +13,20 @@ from pytest_embedded import Dut
|
||||
'no_poisoning',
|
||||
'light_poisoning',
|
||||
'comprehensive_poisoning',
|
||||
]
|
||||
],
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_heap_poisoning(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.host_test
|
||||
@pytest.mark.qemu
|
||||
@pytest.mark.parametrize(
|
||||
'config, embedded_services',
|
||||
[
|
||||
('no_poisoning', 'idf,qemu'),
|
||||
('light_poisoning', 'idf,qemu'),
|
||||
('comprehensive_poisoning', 'idf,qemu')
|
||||
]
|
||||
[('no_poisoning', 'idf,qemu'), ('light_poisoning', 'idf,qemu'), ('comprehensive_poisoning', 'idf,qemu')],
|
||||
)
|
||||
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
|
||||
def test_heap_poisoning_qemu(dut: Dut) -> None:
|
||||
for case in dut.test_menu:
|
||||
if 'qemu-ignore' not in case.groups and not case.is_ignored and case.type == 'normal':
|
||||
@@ -38,13 +34,8 @@ def test_heap_poisoning_qemu(dut: Dut) -> None:
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'in_flash'
|
||||
]
|
||||
)
|
||||
@pytest.mark.parametrize('config', ['in_flash'])
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_heap_in_flash(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
@@ -56,15 +47,9 @@ def test_heap_in_flash(dut: Dut) -> None:
|
||||
'esp32',
|
||||
'esp32s2',
|
||||
'esp32s3',
|
||||
]
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'psram',
|
||||
'psram_all_ext'
|
||||
]
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize('config', ['psram', 'psram_all_ext'])
|
||||
def test_heap(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(group='psram')
|
||||
|
||||
@@ -74,19 +59,11 @@ def test_heap(dut: Dut) -> None:
|
||||
'target',
|
||||
[
|
||||
'esp32',
|
||||
]
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'misc_options'
|
||||
]
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize('config', ['misc_options'])
|
||||
def test_heap_misc_options(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(name=[
|
||||
'IRAM_8BIT capability test',
|
||||
'test allocation and free function hooks'
|
||||
])
|
||||
dut.run_all_single_board_cases(name=['IRAM_8BIT capability test', 'test allocation and free function hooks'])
|
||||
|
||||
dut.expect_exact("Enter next test, or 'enter' to see menu")
|
||||
dut.write('"When enabled, allocation operation failure generates an abort"')
|
||||
@@ -94,14 +71,15 @@ def test_heap_misc_options(dut: Dut) -> None:
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@idf_parametrize(
|
||||
'config,target',
|
||||
[
|
||||
pytest.param('heap_trace_esp32', marks=[pytest.mark.esp32]),
|
||||
pytest.param('heap_trace_hashmap_esp32', marks=[pytest.mark.esp32]),
|
||||
pytest.param('heap_trace_esp32c3', marks=[pytest.mark.esp32c3]),
|
||||
pytest.param('heap_trace_hashmap_esp32c3', marks=[pytest.mark.esp32c3])
|
||||
]
|
||||
('heap_trace_esp32', 'esp32'),
|
||||
('heap_trace_hashmap_esp32', 'esp32'),
|
||||
('heap_trace_esp32c3', 'esp32c3'),
|
||||
('heap_trace_hashmap_esp32c3', 'esp32c3'),
|
||||
],
|
||||
indirect=['config', 'target'],
|
||||
)
|
||||
def test_heap_trace_dump(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(group='trace-dump&internal')
|
||||
@@ -111,13 +89,8 @@ def test_heap_trace_dump(dut: Dut) -> None:
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='support TBD') # TODO [ESP32C61] IDF-9858 IDF-10989
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'mem_prot'
|
||||
]
|
||||
)
|
||||
@pytest.mark.parametrize('config', ['mem_prot'])
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_memory_protection(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(group='heap&mem_prot', timeout=300)
|
||||
|
Reference in New Issue
Block a user