mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
e48dc7139b
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
import pytest
|
|
from pytest_embedded_qemu.dut import QemuDut
|
|
|
|
|
|
def run_group(dut: QemuDut, group: str, timeout: int = 120) -> None:
|
|
"""Run all Unity cases matching a group tag, then verify no failures.
|
|
|
|
pytest-embedded records Unity results without raising on failure,
|
|
so we check dut.testsuite afterwards to surface failures to pytest.
|
|
"""
|
|
cases = [c for c in dut.test_menu if group in c.groups]
|
|
assert cases, f'No cases for group "{group}" (parsed {len(dut.test_menu)} total)'
|
|
|
|
dut.run_all_single_board_cases(group=group, timeout=timeout)
|
|
|
|
failed = dut.testsuite.failed_cases
|
|
if failed:
|
|
names = [tc.name for tc in failed]
|
|
pytest.fail(f'{len(failed)} failed in [{group}]: {", ".join(names)}')
|
|
|
|
|
|
@pytest.mark.host_test
|
|
@pytest.mark.qemu
|
|
@pytest.mark.esp32c3
|
|
def test_get_val(dut: QemuDut) -> None:
|
|
run_group(dut, 'get_val')
|
|
|
|
|
|
@pytest.mark.host_test
|
|
@pytest.mark.qemu
|
|
@pytest.mark.esp32c3
|
|
def test_get_val_type(dut: QemuDut) -> None:
|
|
run_group(dut, 'get_val_type')
|
|
|
|
|
|
@pytest.mark.host_test
|
|
@pytest.mark.qemu
|
|
@pytest.mark.esp32c3
|
|
def test_update_report(dut: QemuDut) -> None:
|
|
run_group(dut, 'report')
|
|
run_group(dut, 'update')
|
|
|
|
|
|
@pytest.mark.host_test
|
|
@pytest.mark.qemu
|
|
@pytest.mark.esp32c3
|
|
def test_jsontlv(dut: QemuDut) -> None:
|
|
run_group(dut, 'jsontlv')
|