2025-02-24 10:18:03 +08:00
|
|
|
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
2023-03-07 12:09:07 +08:00
|
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
import pytest
|
|
|
|
from pytest_embedded import Dut
|
2025-02-24 10:18:03 +08:00
|
|
|
from pytest_embedded_idf.utils import idf_parametrize
|
2023-03-07 12:09:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.generic
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
'config',
|
|
|
|
[
|
|
|
|
'intl',
|
|
|
|
'ext',
|
|
|
|
],
|
|
|
|
indirect=True,
|
|
|
|
)
|
2025-02-24 10:18:03 +08:00
|
|
|
@idf_parametrize('target', ['esp32h2', 'esp32p4', 'esp32c5', 'esp32c61'], indirect=['target'])
|
2023-03-07 12:09:07 +08:00
|
|
|
def test_ana_cmpr_example(dut: Dut) -> None:
|
|
|
|
sdkconfig = dut.app.sdkconfig
|
2025-04-10 16:07:53 +08:00
|
|
|
if sdkconfig['EXAMPLE_REF_FROM_INTERNAL']:
|
|
|
|
dut.expect_exact('Allocate Analog Comparator with internal reference voltage')
|
|
|
|
elif sdkconfig['EXAMPLE_REF_FROM_EXTERNAL']:
|
|
|
|
dut.expect_exact('Allocate Analog Comparator with external reference from GPIO')
|
|
|
|
dut.expect_exact('Analog comparator enabled')
|