mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
test: use pytest for examples/custom_bootloader
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32s2', 'esp32c3'])
|
||||
def test_custom_bootloader_hooks_example(env, _): # type: ignore
|
||||
# Test with default build configurations
|
||||
dut = env.get_dut('main', 'examples/custom_bootloader/bootloader_hooks')
|
||||
dut.start_app()
|
||||
|
||||
# Expect to read both hooks messages
|
||||
dut.expect('This hook is called BEFORE bootloader initialization')
|
||||
dut.expect('This hook is called AFTER bootloader initialization')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_custom_bootloader_hooks_example()
|
@@ -0,0 +1,15 @@
|
||||
# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded.dut import Dut
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.generic
|
||||
def test_custom_bootloader_hooks_example(dut: Dut) -> None:
|
||||
# Expect to read both hooks messages
|
||||
dut.expect_exact('This hook is called BEFORE bootloader initialization')
|
||||
dut.expect_exact('This hook is called AFTER bootloader initialization')
|
Reference in New Issue
Block a user