mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
13 years ago
|
#!/usr/bin/python
|
||
|
|
||
|
import os
|
||
|
import sys
|
||
|
|
||
|
DEVICE_NAME = ""
|
||
|
DEVICE_STR = ""
|
||
12 years ago
|
DEVICE_ARCH = "armeabi"
|
||
13 years ago
|
|
||
|
LOCAL_LOG_PATH = os.path.join(os.getcwd(), "logs")
|
||
|
DEVICE_LOG_PATH = "/sdcard/OpenCVEngineLogs"
|
||
|
DEVICE_BIN_PATH = "/data/data/EngineTest"
|
||
|
|
||
|
def RunTestApp(AppName):
|
||
12 years ago
|
TestLog = os.path.join(DEVICE_LOG_PATH, AppName + "_" + DEVICE_ARCH + ".xml")
|
||
13 years ago
|
os.system("adb %s shell \"LD_LIBRARY_PATH=%s:$LD_LIBRARY_PATH;%s --gtest_output=\"xml:%s\"\"" % (DEVICE_STR, DEVICE_BIN_PATH, os.path.join(DEVICE_BIN_PATH, AppName), TestLog))
|
||
|
os.system("adb %s pull \"%s\" \"%s\"" % (DEVICE_STR, TestLog, LOCAL_LOG_PATH))
|
||
|
|
||
|
if (__name__ == "__main__"):
|
||
12 years ago
|
if (3 == len(sys.argv)):
|
||
12 years ago
|
DEVICE_ARCH = sys.argv[1]
|
||
|
DEVICE_NAME = sys.argv[2]
|
||
12 years ago
|
|
||
12 years ago
|
if (DEVICE_NAME != ""):
|
||
|
DEVICE_STR = "-s \"" + DEVICE_NAME + "\""
|
||
12 years ago
|
|
||
13 years ago
|
if (not os.path.exists(LOCAL_LOG_PATH)):
|
||
12 years ago
|
os.makedirs(LOCAL_LOG_PATH)
|
||
12 years ago
|
|
||
|
print("Waiting for device \"%s\" with arch \"%s\" ..." % (DEVICE_NAME, DEVICE_ARCH))
|
||
13 years ago
|
os.system("adb %s wait-for-device" % DEVICE_STR)
|
||
12 years ago
|
|
||
13 years ago
|
os.system("adb %s shell rm -r \"%s\"" % (DEVICE_STR, DEVICE_LOG_PATH))
|
||
|
os.system("adb %s shell mkdir -p \"%s\"" % (DEVICE_STR, DEVICE_LOG_PATH))
|
||
|
|
||
|
RunTestApp("OpenCVEngineTestApp")
|