Skip to content

Commit

Permalink
update run.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
if1else0 committed Oct 28, 2015
1 parent eaf8387 commit 154b068
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
import os
import fileinput
#删除存在的log文件或者报告文件,避免以前构建产生的数据对当前构建造成影响

if os.path.exists("log.txt"):
os.remove("log.txt")
if os.path.exists("log.xml"):
os.remove("log.xml")

#编译生成jar

os.system("ant build")

#push jar到设备

os.system("adb push bin/newtest.jar /data/local/tmp/")

#遍历读取testsuites.txt文件里的每一行信息

for line in fileinput.input("testsuites.txt"):
#如果这一行的文本不为空
if len(line.strip()) != 0 :
#拼接执行的遇见,并把log输出到外部文件log.txt
exeStr = "adb shell uiautomator runtest newtest.jar -c " + line.strip() + " >>log.txt"
#执行拼接完的语句
os.system(exeStr)

#转化log文件为JUnit报告
os.system("java -jar log-converter.jar log.txt")

0 comments on commit 154b068

Please sign in to comment.