-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunchXTSwithErrorDetection.py
More file actions
executable file
·28 lines (22 loc) · 1.19 KB
/
launchXTSwithErrorDetection.py
File metadata and controls
executable file
·28 lines (22 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
import mobiletestlib
import os
import sys
#== Main Flow ==
# Check Target is existed 檢查Target有沒有給
if(len(sys.argv) < 2):
print 'You have to tell me the target:\n\n ./launchXTSwithErrorDetection.sh TARGET'
exit() # End up Script
# Run Test 要跑測試了
target = sys.argv[1]
mobiletestlib.testType = 'XTS' # 改為你的測試類型,給人類看的
mobiletestlib.deviceName = 'G2@Ntut' # 改為你要加的前綴,給人類看的
if(mobiletestlib.isPOSIX()):
# POSIX(Unix-like) OS can run xts directly
mobiletestlib.runTestProcess('exec ./xts-tradefed run xts --plan XTS --serial ' + target, target) # 直接下Command line
else:
XTS_HOME = os.environ['XTS_HOME'] # Set Env Path Var just for Windows
XTS_ROOT = os.environ['XTS_ROOT']
# Run java because of Capturing Running STDOUT under WindowsNT Family Platform
mobiletestlib.runWinTestProcess( ['java','-Xmx512M','-cp','%s\\tools\\xts-tradefed.jar;%s\\tools\\hosttestlib.jar;%s\\tools\\ddmlib-prebuilt.jar;%s\\tools\\tradefed-prebuilt.jar'%(XTS_HOME,XTS_HOME,XTS_HOME,XTS_HOME),'-DXTS_ROOT=%s'%(XTS_ROOT),'com.android.xts.tradefed.command.XtsConsole','run','xts','--plan','XTS','--serial',target], target)
exit()