mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
touch_sensor: add pytest for all examples
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.generic
|
||||
def test_touch_pad_interrupt_v1(dut: Dut) -> None:
|
||||
dut.expect_exact('Touch pad: Initializing touch pad')
|
||||
dut.expect(r'test init: touch pad \[\d+\] val is \d+')
|
||||
dut.expect_exact('Touch pad: Waiting for any pad being touched...')
|
||||
dut.expect_exact('Touch pad: Change mode...filter mode')
|
||||
dut.expect_exact('Touch pad: Waiting for any pad being touched...')
|
@@ -0,0 +1,12 @@
|
||||
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.generic
|
||||
def test_touch_pad_read_v1(dut: Dut) -> None:
|
||||
dut.expect_exact('Touch Sensor filter mode read, the output format is:')
|
||||
dut.expect(r'T0:\[\s*\d+,\s*\d+\] T1:\[\s*\d+,\s*\d+\] T2:\[\s*\d+,\s*\d+\] T3:\[\s*\d+,\s*\d+\] T4:\[\s*\d+,\s*\d+\]'
|
||||
r' T5:\[\s*\d+,\s*\d+\] T6:\[\s*\d+,\s*\d+\] T7:\[\s*\d+,\s*\d+\] T8:\[\s*\d+,\s*\d+\] T9:\[\s*\d+,\s*\d+\]')
|
Reference in New Issue
Block a user