mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 16:14:34 +02:00
ci: refactor a few test scripts to pytest
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
import tiny_test_fw
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_custom_test(env_tag='Example_GENERIC')
|
||||
def test_startup(env, _): # type: (tiny_test_fw.Env.Env, None) -> None
|
||||
# Only test for master usage.
|
||||
dut = env.get_dut('i2c_wifi', 'tools/test_apps/peripherals/i2c_wifi')
|
||||
dut.start_app()
|
||||
|
||||
dut.expect('I2C-WIFI test success')
|
||||
|
||||
env.close_dut(dut.name)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_startup()
|
11
tools/test_apps/peripherals/i2c_wifi/pytest_i2c_wifi.py
Normal file
11
tools/test_apps/peripherals/i2c_wifi/pytest_i2c_wifi.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded_idf.dut import IdfDut
|
||||
|
||||
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.generic
|
||||
def test_startup(dut: IdfDut) -> None:
|
||||
dut.expect_exact('I2C-WIFI test success')
|
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import glob
|
||||
import os
|
||||
|
||||
import tiny_test_fw
|
||||
import ttfw_idf
|
||||
from tiny_test_fw import Utility
|
||||
|
||||
|
||||
@ttfw_idf.idf_custom_test(env_tag='Example_GENERIC', group='test-apps')
|
||||
def test_phy_multi_init_data_bin(env, _):
|
||||
# type: (tiny_test_fw.Env.Env, None) -> None
|
||||
config_files = glob.glob(os.path.join(os.path.dirname(__file__), 'sdkconfig.ci.*'))
|
||||
config_names = [os.path.basename(s).replace('sdkconfig.ci.', '') for s in config_files]
|
||||
for name in config_names:
|
||||
dut = env.get_dut('phy_multi_init_data_test', 'tools/test_apps/phy/phy_multi_init_data_test',app_config_name=name)
|
||||
dut.start_app()
|
||||
|
||||
if 'CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED' in dut.app.get_sdkconfig().keys():
|
||||
Utility.console_log('multi init data bin embed test')
|
||||
dut.expect('load embedded multi phy init data')
|
||||
else:
|
||||
Utility.console_log('multi init data bin test')
|
||||
dut.expect('Support multiple PHY init data bins')
|
||||
|
||||
dut.expect('wifi_init finished')
|
||||
Utility.console_log('Test Success')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_phy_multi_init_data_bin()
|
@@ -0,0 +1,19 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded_idf.dut import IdfDut
|
||||
|
||||
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', [
|
||||
'phy_multiple_init_data',
|
||||
'phy_multiple_init_data_embed',
|
||||
], indirect=True)
|
||||
def test_phy_multi_init_data_bin(dut: IdfDut, config: str) -> None:
|
||||
if config == 'phy_multiple_init_data':
|
||||
dut.expect_exact('Support multiple PHY init data bins')
|
||||
else:
|
||||
dut.expect_exact('load embedded multi phy init data')
|
||||
dut.expect_exact('wifi_init finished')
|
Reference in New Issue
Block a user