diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2015-12-08 01:58:26 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2016-02-06 01:07:52 +0800 |
commit | 71d23eb988272df0c2817abd7c713aca78a1c7f2 (patch) | |
tree | f3bb3e5a1d1d712493e6d73b390d8c97fbdc4f03 | |
parent | ee8577db98cfae44411aa5c714b189468fb41c0c (diff) |
andebenchpro2015: add support to andebenchpro2015 test
we need to use the andebenchpro2015 version for marshmallow builds
Change-Id: I251eb634f479baf76f6c0ae80d0ff1f5e1780650
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-x | andebenchpro2015/execute.sh | 56 | ||||
-rw-r--r-- | andebenchpro2015/vc.py | 67 |
2 files changed, 123 insertions, 0 deletions
diff --git a/andebenchpro2015/execute.sh b/andebenchpro2015/execute.sh new file mode 100755 index 0000000..7164a11 --- /dev/null +++ b/andebenchpro2015/execute.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +#need to be defined for different benchmark apks +apk_package="com.eembc.andebench" +activity="com.eembc.andebench/.splash" +apk_file_name="andebench-pro_2015.apk" +test_method="python vc.py" + +#following should no need to modify +parent_dir=`dirname ${0}` +source "${parent_dir}/../common/common.sh" + +function get_result(){ + local host_csv_f="${D_RAWDATA}/andebench.log.csv" + adb pull /mnt/sdcard/Download/andebench.log.csv "${host_csv_f}" + sed -i 's/ /_/g' "${host_csv_f}" + sed -i 's/(\|)//g' "${host_csv_f}" + local regex="^CoreMark-PRO|^Memory Bandwidth,|^Memory Latency,|^Storage,|^Platform,|^3D,|^Overall" + for line in $(grep -P "${regex}" ${host_csv_f}); do + local field1=$(echo $line|cut -d, -f1) + local field2=$(echo $line|cut -d, -f2) + local field3=$(echo $line|cut -d, -f3) + + local key="" + local value="" + local result="" + local units="" + if [ -z "${field3}" ]; then + key="${field1}" + value="${field2}" + else + key="${field1}_${field2}" + value="${field3}" + fi + old_value="${value}" + if echo "${old_value}"|grep -q -P '\d$'; then + value="${old_value}" + units="points" + result="pass" + elif [ "X${old_value}" = "XNA" ];then + result="fail" + else + value=$(echo ${old_value}|tr -d "[:alpha:]/") + units=$(echo ${old_value}|tr -d "[:digit:].") + result="pass" + fi + if [ "X${result}" = "Xpass" ]; then + output_test_result "andebenchpro2015_${key}" "pass" "${value}" "${units}" + else + output_test_result "andebenchpro2015_${key}" "fail" + fi + done +} +pre_uninstall="get_result" +timeout=60m +main "$@" diff --git a/andebenchpro2015/vc.py b/andebenchpro2015/vc.py new file mode 100644 index 0000000..1a1072c --- /dev/null +++ b/andebenchpro2015/vc.py @@ -0,0 +1,67 @@ +import re +import sys +import os +import time +from subprocess import call + +from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException + +kwargs1 = {'verbose': False, 'ignoresecuredevice': False} +device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1) +kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': True} +vc = ViewClient(device, serialno, **kwargs2) + +def dump_always(): + success = False + while not success: + try: + vc.dump() + success = True + except RuntimeError: + print("Got RuntimeError when call vc.dump()") + time.sleep(5) + except ValueError: + print("Got ValueError when call vc.dump()") + time.sleep(5) + + +time.sleep(2) +dump_always() +btn_license = vc.findViewWithText(u'I Agree') +if btn_license: + btn_license.touch() + +while True: + try: + dump_always() + btn_start_on = vc.findViewByIdOrRaise("com.eembc.andebench:id/s1_runall") + btn_start_on.touch() + break + except ViewNotFoundException: + pass + except RuntimeError: + pass + except ValueError: + pass + +find_result = False +while not find_result: + try: + time.sleep(30) + dump_always() + vc.findViewWithTextOrRaise("DEVICE SCORE") + + vc.findViewWithTextOrRaise(u'3D').touch() + vc.findViewWithTextOrRaise(u'Platform').touch() + vc.findViewWithTextOrRaise(u'Storage').touch() + vc.findViewWithTextOrRaise(u'Memory Latency').touch() + vc.findViewWithTextOrRaise(u'Memory Bandwidth').touch() + vc.findViewWithTextOrRaise(u'CoreMark-PRO (Peak)').touch() + vc.findViewWithTextOrRaise(u'CoreMark-PRO (Base)').touch() + find_result = True + except ViewNotFoundException: + pass + except RuntimeError: + pass + except ValueError: + pass |