mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
unit_test.py: Allow importing tiny-test-fw from IDF_PATH as well as TEST_FW_PATH
This commit is contained in:
committed by
Angus Gratton
parent
d8b625a32c
commit
0a27cfa850
@@ -25,13 +25,22 @@ import time
|
|||||||
import argparse
|
import argparse
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
# if we want to run test case outside `tiny-test-fw` folder,
|
try:
|
||||||
# we need to insert tiny-test-fw path into sys path
|
import TinyFW
|
||||||
test_fw_path = os.getenv("TEST_FW_PATH")
|
except ImportError:
|
||||||
if test_fw_path and test_fw_path not in sys.path:
|
# if we want to run test case outside `tiny-test-fw` folder,
|
||||||
sys.path.insert(0, test_fw_path)
|
# we need to insert tiny-test-fw path into sys path
|
||||||
|
test_fw_path = os.getenv("TEST_FW_PATH")
|
||||||
|
if test_fw_path and test_fw_path not in sys.path:
|
||||||
|
sys.path.insert(0, test_fw_path)
|
||||||
|
else:
|
||||||
|
# or try the copy in IDF
|
||||||
|
idf_path = os.getenv("IDF_PATH")
|
||||||
|
tiny_test_path = idf_path + "/tools/tiny-test-fw"
|
||||||
|
if os.path.exists(tiny_test_path):
|
||||||
|
sys.path.insert(0, tiny_test_path)
|
||||||
|
import TinyFW
|
||||||
|
|
||||||
import TinyFW
|
|
||||||
import IDF
|
import IDF
|
||||||
import Utility
|
import Utility
|
||||||
import Env
|
import Env
|
||||||
|
Reference in New Issue
Block a user