diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2015-03-04 00:08:58 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2015-03-30 16:40:33 +0000 |
commit | 37478ee861175076f896a2f671d299a434db6279 (patch) | |
tree | e92517d2c49616861fb1cdf15e424831778894c9 | |
parent | 5a336a0f10ef8c7cbbec35e5bd7380271c3dd853 (diff) |
Add test for AndEBench Pro
Change-Id: I7a673edb4b70f76090bdf57ffca01cac39599f61
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-x | andebenchpro/execute.sh | 55 | ||||
-rw-r--r-- | andebenchpro/vc.py | 53 |
2 files changed, 108 insertions, 0 deletions
diff --git a/andebenchpro/execute.sh b/andebenchpro/execute.sh new file mode 100755 index 0000000..6cfb5df --- /dev/null +++ b/andebenchpro/execute.sh @@ -0,0 +1,55 @@ +#!/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.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-HPC|^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 "${key}" "pass" "${value}" "${units}" + else + output_test_result "${key}" "fail" + fi + done +} +pre_uninstall="get_result" +main "$@" diff --git a/andebenchpro/vc.py b/andebenchpro/vc.py new file mode 100644 index 0000000..375a0ed --- /dev/null +++ b/andebenchpro/vc.py @@ -0,0 +1,53 @@ +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': False} +vc = ViewClient(device, serialno, **kwargs2) + +time.sleep(2) +vc.dump() +btn_license = vc.findViewWithText(u'I Agree') +if btn_license: + btn_license.touch() + +while True: + try: + time.sleep(5) + vc.dump() + 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 + +while(True): + try: + time.sleep(30) + vc.dump('-1') + vc.findViewByIdOrRaise("com.eembc.andebench:id/view_web_button") + + 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-HPC (Peak)').touch() + vc.findViewWithTextOrRaise(u'CoreMark-HPC (Base)').touch() + break + except ViewNotFoundException: + pass + except RuntimeError: + pass + except ValueError: + pass |