2024-04-01 00:25:38 -04:00
|
|
|
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
2022-03-07 22:15:37 -05:00
|
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
import logging
|
|
|
|
import os
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from pytest_embedded import Dut
|
|
|
|
|
|
|
|
|
2023-10-18 02:39:33 -04:00
|
|
|
@pytest.mark.supported_targets
|
2022-03-07 22:15:37 -05:00
|
|
|
@pytest.mark.generic
|
|
|
|
def test_eventfd(dut: Dut) -> None:
|
|
|
|
|
2022-12-09 03:06:44 -05:00
|
|
|
dut.expect_exact('main_task: Calling app_main()')
|
2022-03-07 22:15:37 -05:00
|
|
|
|
|
|
|
exp_list_5seconds = [
|
|
|
|
'eventfd_example: Select timeouted for 1 times',
|
2024-04-01 00:25:38 -04:00
|
|
|
'eventfd_example: Timer triggered for 2 times',
|
|
|
|
'eventfd_example: Progress triggered for 1 times',
|
2022-03-07 22:15:37 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
exp_list_10seconds = [
|
|
|
|
'eventfd_example: Select timeouted for 2 times',
|
2024-04-01 00:25:38 -04:00
|
|
|
'eventfd_example: Timer triggered for 4 times',
|
|
|
|
'eventfd_example: Progress triggered for 2 times',
|
2022-03-07 22:15:37 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
logging.info('Expecting:{}{}'.format(os.linesep, os.linesep.join(exp_list_5seconds)))
|
|
|
|
for exp in exp_list_5seconds:
|
|
|
|
dut.expect_exact(exp)
|
|
|
|
|
|
|
|
logging.info('Expecting:{}{}'.format(os.linesep, os.linesep.join(exp_list_10seconds)))
|
|
|
|
for exp in exp_list_10seconds:
|
|
|
|
dut.expect_exact(exp)
|