mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
c906e2afee
tiny_test_fw is a python package now. import it using normal way.
36 lines
956 B
Python
36 lines
956 B
Python
from __future__ import print_function
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
|
|
import ttfw_idf
|
|
|
|
|
|
@ttfw_idf.idf_example_test(env_tag='Example_WIFI')
|
|
def test_examples_parttool(env, extra_data):
|
|
dut = env.get_dut('parttool', 'examples/storage/parttool', dut_class=ttfw_idf.ESP32DUT)
|
|
dut.start_app(False)
|
|
|
|
# Verify factory firmware
|
|
dut.expect("Partitions Tool Example")
|
|
dut.expect("Example end")
|
|
|
|
# Close connection to DUT
|
|
dut.receive_thread.exit()
|
|
dut.port_inst.close()
|
|
|
|
# Run the example python script
|
|
script_path = os.path.join(os.getenv("IDF_PATH"), "examples", "storage", "parttool", "parttool_example.py")
|
|
|
|
binary_path = ""
|
|
for flash_file in dut.app.flash_files:
|
|
if "parttool.bin" in flash_file[1]:
|
|
binary_path = flash_file[1]
|
|
break
|
|
|
|
subprocess.check_call([sys.executable, script_path, "--binary", binary_path])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
test_examples_parttool()
|