summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2015-03-09 23:52:06 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2015-03-16 01:11:30 +0800
commit11b3ba6ed690e07e3a3b9da5e9cddde58e48719d (patch)
tree0c2b6f473e4ea1f59fd5c6870dd5756e1d62a4a2
parent57f691897dfaff13c54cda6e21dfe91e25d86c13 (diff)
Add support to run multiple benchmarks together
Change-Id: I38500396f976630a80b011d73c0bed62b6a7d7bd Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--andebench2014/vc.py5
-rw-r--r--application-benchmark-host.yaml2
-rw-r--r--application-benchmark-target.yaml1
-rwxr-xr-xbenchmarkpi/vc.py6
-rwxr-xr-xcommon/common.sh3
-rw-r--r--common/common2.sh24
-rwxr-xr-xcommon/output-test-result.sh7
-rw-r--r--common/statistic_average.sh75
-rw-r--r--java-benchmarks-host.yaml42
-rwxr-xr-xjava-benchmarks.sh64
-rw-r--r--javawhetstone/vc.py5
-rw-r--r--jbench/vc.py5
-rw-r--r--linpack/vc.py11
-rw-r--r--linpackjava/vc.py5
-rw-r--r--scimark/vc.py8
-rwxr-xr-xsmartbench2012/execute.sh2
-rwxr-xr-xsmartbench2012/extract_results.sh3
-rwxr-xr-xsmartbench2012/vc.py18
18 files changed, 241 insertions, 45 deletions
diff --git a/andebench2014/vc.py b/andebench2014/vc.py
index b778db0..d04ba33 100644
--- a/andebench2014/vc.py
+++ b/andebench2014/vc.py
@@ -6,6 +6,9 @@ from subprocess import call
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException
+parent_dir = os.path.realpath(os.path.dirname(__file__))
+f_output_result="%s/../common/output-test-result.sh" % parent_dir
+
kwargs1 = {'verbose': False, 'ignoresecuredevice': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': False}
@@ -34,7 +37,7 @@ while(not finished):
test_case_id = result.group('test_case_id').strip()
measurement = result.group('measurement').strip()
print "%s=%s Iterations/sec" % (test_case_id, measurement)
- call(['lava-test-case', test_case_id, '--result', 'pass', '--measurement', measurement, '--units', 'Iterations/sec'])
+ call([f_output_result, test_case_id, 'pass', measurement, 'Iterations/sec'])
except ViewNotFoundException:
pass
except RuntimeError:
diff --git a/application-benchmark-host.yaml b/application-benchmark-host.yaml
index cbbb1c8..6c3f5b0 100644
--- a/application-benchmark-host.yaml
+++ b/application-benchmark-host.yaml
@@ -18,7 +18,7 @@ metadata:
os:
- android
scope:
- - functional
+ - performance
devices:
- kvm
diff --git a/application-benchmark-target.yaml b/application-benchmark-target.yaml
index c9fb804..2e29039 100644
--- a/application-benchmark-target.yaml
+++ b/application-benchmark-target.yaml
@@ -17,6 +17,7 @@ run:
- lava-test-case step1-cat-build-info --shell cat /system/build.prop
- lava-test-case step2-get-adb --shell getprop service.adb.tcp.port
- lava-test-case step3-set-adb --shell setprop service.adb.tcp.port 5555
+ - lava-test-case step3-set-adb-root --shell setprop service.adb.root 1
- lava-test-case step4-stop-adbd --shell stop adbd
- lava-test-case step5-start-adbd --shell start adbd
- lava-test-case step6-send-ip --shell lava-send application-benchmark-target-ready-send-ip ipaddr=$(getprop dhcp.eth0.ipaddress)
diff --git a/benchmarkpi/vc.py b/benchmarkpi/vc.py
index 408f479..0902061 100755
--- a/benchmarkpi/vc.py
+++ b/benchmarkpi/vc.py
@@ -1,13 +1,17 @@
# Author: Botao Sun <botao.sun@linaro.org>
+import os
import sys
import time
from subprocess import call
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException
+parent_dir = os.path.realpath(os.path.dirname(__file__))
+f_output_result="%s/../common/output-test-result.sh" % parent_dir
+
def collect_score(benchmark_name, run_result, score_number, score_unit):
- call(['lava-test-case', benchmark_name, '--result', run_result, '--measurement', score_number, '--units', score_unit])
+ call([f_output_result, benchmark_name, run_result, score_number, score_unit])
benchmark_name = "BenchmarkPi"
kwargs1 = {'verbose': False, 'ignoresecuredevice': False}
diff --git a/common/common.sh b/common/common.sh
index 059ee62..4fd5ed8 100755
--- a/common/common.sh
+++ b/common/common.sh
@@ -24,8 +24,7 @@ func_install_start_RotationAPK(){
if [ -f "${apk_path}" ]; then
echo "The file(${apk_path}) already exists."
else
- local apk_base_url="http://testdata.validation.linaro.org/apks/"
- get_file_with_base_url "${apk_name}" "${apk_base_url}" "${D_APKS}"
+ get_file_with_base_url "${apk_name}" "${base_url}" "${D_APKS}"
fi
adb shell pm list packages | grep rotation.off
if [ $? -ne 0 ]; then
diff --git a/common/common2.sh b/common/common2.sh
index 57962c7..a11de4f 100644
--- a/common/common2.sh
+++ b/common/common2.sh
@@ -22,15 +22,16 @@ BASE_URL=""
## Description:
## get specified the apk file from remote
## Usage:
-## get_file_with_base_url $file_name $base_url $target_dir
+## get_file_with_base_url $remote_relative_path $base_url $target_dir
## Example:
## get_file_with_base_url "${apk_apk}" "${BASE_URL}" "${D_APKS}"
get_file_with_base_url(){
- local file_name=$1 && shift
+ local remote_rel_path=$1 && shift
+ base_name=$(basename ${remote_rel_path})
local base_url=$1 && shift
local target_dir=$1 && shift
- if [ -z "${file_name}" ]; then
+ if [ -z "${remote_rel_path}" ]; then
echo "The file name must be specified."
return 1
fi
@@ -45,19 +46,19 @@ get_file_with_base_url(){
return 1
fi
- if [ -f "${target_dir}/${file_name}" ]; then
- echo "The file($file_name) already exists."
+ if [ -f "${target_dir}/${base_name}" ]; then
+ echo "The file(${remote_rel_path}) already exists."
return 0
fi
mkdir -p "${target_dir}"
case "X${base_url}" in
"Xscp://"*)
# like scp://yongqin.liu@testdata.validation.linaro.org/home/yongqin.liu
- apk_url="${base_url}/${file_name}"
+ apk_url="${base_url}/${remote_rel_path}"
url_no_scp=`echo ${apk_url}|sed 's/^\s*scp\:\/\///'|sed 's/\//\:\//'`
- scp "${url_no_scp}" "${target_dir}/${file_name}"
+ scp "${url_no_scp}" "${target_dir}/${base_name}"
if [ $? -ne 0 ]; then
- echo "Failed to get the apk(${file_name}) with ${base_url}"
+ echo "Failed to get the apk(${remote_rel_path}) with ${base_url}"
return 1
fi
;;
@@ -69,14 +70,14 @@ get_file_with_base_url(){
fi
;;
"Xhttp://"*)
- wget "${base_url}/${file_name}" -O "${target_dir}/${file_name}"
+ wget "${base_url}/${remote_rel_path}" -O "${target_dir}/${base_name}"
if [ $? -ne 0 ]; then
echo "Failed to get the apks with ${base_url}"
return 1
fi
;;
"X"*)
- echo "Failed to get the file($file_name)."
+ echo "Failed to get the file($remote_rel_path)."
echo "The schema of the ${base_url} is not supported now!"
return 1
;;
@@ -281,6 +282,7 @@ func_loop_apps_for_times(){
for apk in ${loop_apps_list}; do
local loop_app_apk=$(echo $apk|cut -d, -f1)
+ loop_app_apk=$(basename ${loop_app_apk})
local loop_app_start_activity=$(echo $apk|cut -d, -f2)
local loop_app_package=$(echo ${loop_app_start_activity}|cut -d\/ -f1)
local loop_app_name=$(echo $apk|cut -d, -f3)
@@ -383,6 +385,8 @@ func_prepare_environment(){
func_get_all_apks "$G_APPS"|| exit 1
adb shell svc power stayon true
+ adb shell input keyevent MENU
+ adb shell input keyevent BACK
}
func_print_usage_common(){
diff --git a/common/output-test-result.sh b/common/output-test-result.sh
new file mode 100755
index 0000000..b54349a
--- /dev/null
+++ b/common/output-test-result.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+local_common_file_path="$0"
+local_common_parent_dir=$(cd $(dirname ${local_common_file_path}); pwd)
+source "${local_common_parent_dir}/statistic_average.sh"
+
+output_test_result "$@"
diff --git a/common/statistic_average.sh b/common/statistic_average.sh
index 31ec3d9..8f91395 100644
--- a/common/statistic_average.sh
+++ b/common/statistic_average.sh
@@ -1,5 +1,9 @@
#!/bin/bash
+local_common_file_path="${BASH_SOURCE[0]}"
+local_common_parent_dir=$(cd $(dirname ${local_common_file_path}); pwd)
+f_result_csv="${local_common_parent_dir}/../rawdata/final_result.csv"
+
## Description:
## output the max value of the passed 2 parameters
## Usage:
@@ -7,10 +11,10 @@
## Example:
## max=$(f_max "1.5" "2.0")
f_max(){
- local val1=$1 && shift
- local val2=$1 && shift
- [ -z "$val1" ] && return $val2
- [ -z "$val2" ] && return $val1
+ local val1=$1
+ local val2=$2
+ [ -z "$val1" ] && echo $val2
+ [ -z "$val2" ] && echo $val1
local compare=$(echo "$val1>$val2"|bc)
if [ "X$compare" = "X1" ];then
@@ -27,10 +31,10 @@ f_max(){
## Example:
## min=$(f_min "1.5" "2.0")
f_min(){
- local val1=$1 && shift
- local val2=$1 && shift
- [ -z "$val1" ] && return $val1
- [ -z "$val2" ] && return $val2
+ local val1=$1
+ local val2=$2
+ [ -z "$val1" ] && echo $val1
+ [ -z "$val2" ] && echo $val2
local compare=$(echo "$val1<$val2"|bc)
if [ "X$compare" = "X1" ];then
@@ -49,14 +53,14 @@ f_min(){
## Example:
## statistic "$f_res_starttime" 2
## Note:
-## if less than 4 samples for that key/item there, average will be calculated as total/count
-## if 4 or more samples for that key/item there, average will be calculated with max and min excluded
+## if less than 4 samples for that key/item there, average will be calculated as total/count
+## if 4 or more samples for that key/item there, average will be calculated with max and min excluded
statistic(){
- local f_data=$1 && shift
+ local f_data=$1
if ! [ -f "$f_data" ]; then
return
fi
- local field_no=$1 && shift
+ local field_no=$2
if [ -z "$field_no" ]; then
field_no=2
fi
@@ -102,3 +106,50 @@ statistic(){
echo "$new_key=$average"
fi
}
+
+## Description:
+## output the test result to console and add for lava-test-shell,
+## also write into one csv file for comparing manually
+## Usage:
+## output_test_result $test_name $result [ $measurement [ $units ] ]
+output_test_result(){
+ local test_name=$1
+ local result=$2
+ local measurement=$3
+ local units=$4
+
+ if [ -z "${test_name}" ] || [ -z "$result" ]; then
+ return
+ fi
+ local output=""
+ local lava_paras=""
+ local output_csv=""
+ test_name=$(echo ${test_name}|tr ' ' '_')
+ if [ -z "${measurement}" ]; then
+ output="${test_name}=${result}"
+ lava_paras="${test_name} --result ${result}"
+ else
+ output="${test_name}=${measurement}"
+ lava_paras="${test_name} --result ${result} --measurement ${measurement}"
+ output_csv="${test_name},${measurement}"
+ fi
+
+ if [ -z "$units" ]; then
+ units="points"
+ fi
+ output="${output} ${units}"
+ lava_paras="${lava_paras} --units ${units}"
+
+ echo "${output}"
+
+ local cmd="lava-test-case"
+ if [ -n "$(which $cmd)" ];then
+ $cmd ${lava_paras}
+ else
+ echo "$cmd ${lava_paras}"
+ fi
+ if [ -n "${output_csv}" ];then
+ mkdir -p $(dirname ${f_result_csv})
+ echo "${output_csv}">>${f_result_csv}
+ fi
+}
diff --git a/java-benchmarks-host.yaml b/java-benchmarks-host.yaml
new file mode 100644
index 0000000..9e2cecc
--- /dev/null
+++ b/java-benchmarks-host.yaml
@@ -0,0 +1,42 @@
+metadata:
+ name: java-benchmarks-host
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Run multiple benchmark applications togather one time"
+ maintainer:
+ - yongqin.liu@linaro.org
+ os:
+ - android
+ scope:
+ - performance
+ devices:
+ - kvm
+
+install:
+ git-repos:
+ - https://github.com/mwasilew/AndroidViewClient.git
+ steps:
+ - cd AndroidViewClient/
+ - python setup.py install
+ deps:
+ - git
+ - python-lxml
+ - python-pil
+ - python-setuptools
+
+params:
+ APP_CONFIG_LIST: ""
+ LOOP_COUNT: 12
+ COLLECT_STREAMLINE: "false"
+
+run:
+ steps:
+ - apt-add-repository -y http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu
+ - apt-get update -y
+ - apt-get install -y android-tools-adb android-tools-fastboot zip
+ - lava-wait application-benchmark-target-ready-send-ip
+ - IPADDR=`awk -F '=' '{print $2}' /tmp/lava_multi_node_cache.txt`
+ - adb connect $IPADDR
+ - adb wait-for-device
+ - ./java-benchmarks.sh --base-url "$BASE_URL" --loop-count "$LOOP_COUNT" --streamline "$COLLECT_STREAMLINE" $APP_CONFIG_LIST
+ - lava-test-run-attach rawdata.zip application/x-gzip
+ - lava-sync application-benchmark-stop-target
diff --git a/java-benchmarks.sh b/java-benchmarks.sh
new file mode 100755
index 0000000..32127c2
--- /dev/null
+++ b/java-benchmarks.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+local_file_path="${BASH_SOURCE[0]}"
+local_parent_dir=$(cd $(dirname ${local_file_path}); pwd)
+source ${local_parent_dir}/common/common.sh
+source ${local_parent_dir}/common/statistic_average.sh
+
+base_url="http://testdata.validation.linaro.org/apks/"
+#base_url="scp://testdata//home/testdata.validation.linaro.org/apks"
+timeout=120m
+
+func_post_uninstall_smartbench2012(){
+ ${local_parent_dir}/smartbench2012/extract_results.sh
+}
+function func_post_uninstall_bench_batch(){
+ func_post_uninstall
+ if [ "X${loop_app_name}" = "Xsmartbench2012" ]; then
+ func_post_uninstall_smartbench2012
+ fi
+}
+
+func_post_test_batch(){
+ func_cleanup
+
+ sort ${f_result_csv}|tr ' ' '_'|tr -d '=' >${f_result_csv}.sort
+ statistic "${f_result_csv}.sort" 2|tee ${f_result_csv}.ok
+ sed -i 's/=/,/' "${f_result_csv}.ok"
+}
+
+function main(){
+ echo "test timeout: ${timeout}"
+ parent_dir=$(cd ${parent_dir}; pwd)
+ export parent_dir=${parent_dir}
+
+ var_func_parse_parameters=""
+ var_func_prepare_environment="func_prepare_benchmark"
+ var_func_post_test="func_post_test_batch"
+
+ var_func_pre_install=""
+ var_func_post_install="${post_install}"
+ var_func_run_test="func_run_test_bench"
+ var_test_command=""
+ var_test_command_timeout="${timeout}"
+ var_func_pre_uninstall="${pre_uninstall}"
+ var_func_post_uninstall="func_post_uninstall_bench_batch"
+
+ G_APPS="${G_APPS} JavaBenchmark/pure-java-benchmarks/01-Java_Whetstone.apk,com.roywhet/.JavaWhetstoneActivity,javawhetstone"
+ G_APPS="${G_APPS} JavaBenchmark/pure-java-benchmarks/03-JBench.apk,it.JBench.bench/it.JBench.jbench.MainActivity,jbench"
+ G_APPS="${G_APPS} JavaBenchmark/pure-java-benchmarks/02-LinpackJava.apk,com.LinpackJava/.LinpackJavaActivity,linpackjava"
+ G_APPS="${G_APPS} JavaBenchmark/non-pure-java-benchmarks/03-SciMark.apk,net.danielroggen.scimark/.ActivityMain,scimark"
+ G_APPS="${G_APPS} JavaBenchmark/non-pure-java-benchmarks/02-AndEBench2014.apk,com.eembc.coremark/.tabs,andebench2014"
+ G_APPS="${G_APPS} gr.androiddev.BenchmarkPi-1.apk,gr.androiddev.BenchmarkPi/.BenchmarkPi,benchmarkpi"
+ G_APPS="${G_APPS} com.greenecomputing.linpack-1.apk,com.greenecomputing.linpack/.Linpack,linpack"
+ G_APPS="${G_APPS} Smartbench2012.apk,com.smartbench.twelve/.Smartbench2012,smartbench2012"
+ G_LOOP_COUNT=12
+ BASE_URL="${base_url}"
+ common_main "$@"
+
+ return ${ret_value}
+}
+
+rm -fr ${f_result_csv}
+
+main "$@"
diff --git a/javawhetstone/vc.py b/javawhetstone/vc.py
index 5e483e1..f336ba8 100644
--- a/javawhetstone/vc.py
+++ b/javawhetstone/vc.py
@@ -6,6 +6,9 @@ from subprocess import call
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException
+parent_dir = os.path.realpath(os.path.dirname(__file__))
+f_output_result="%s/../common/output-test-result.sh" % parent_dir
+
kwargs1 = {'verbose': False, 'ignoresecuredevice': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': False}
@@ -50,7 +53,7 @@ while(not finished):
else:
continue
print "%s=%s %s" % (key, value, units)
- call(['lava-test-case', key, '--result', 'pass', '--measurement', value, '--units', units])
+ call([f_output_result, key, 'pass', value, units])
except ViewNotFoundException:
pass
except RuntimeError:
diff --git a/jbench/vc.py b/jbench/vc.py
index a491e90..1dfa054 100644
--- a/jbench/vc.py
+++ b/jbench/vc.py
@@ -6,6 +6,9 @@ from subprocess import call
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException
+parent_dir = os.path.realpath(os.path.dirname(__file__))
+f_output_result="%s/../common/output-test-result.sh" % parent_dir
+
kwargs1 = {'verbose': False, 'ignoresecuredevice': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': False}
@@ -26,7 +29,7 @@ while(not finished):
finished = True
print "benchmark finished"
print "%s=%s" % ("JBench", results.getText().strip())
- call(['lava-test-case', "JBench", '--result', 'pass', '--measurement', results.getText().strip(), '--units', 'points'])
+ call([f_output_result, "JBench", 'pass', results.getText().strip(), "points"])
except ViewNotFoundException:
pass
except RuntimeError:
diff --git a/linpack/vc.py b/linpack/vc.py
index aa96833..92f72b2 100644
--- a/linpack/vc.py
+++ b/linpack/vc.py
@@ -6,6 +6,9 @@ from subprocess import call
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException
+parent_dir = os.path.realpath(os.path.dirname(__file__))
+f_output_result="%s/../common/output-test-result.sh" % parent_dir
+
kwargs1 = {'verbose': False, 'ignoresecuredevice': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': False}
@@ -26,8 +29,8 @@ while not start_single_button:
mflops_single_score = vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txtmflops_result")
time_single_score = vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txttime_result")
-call(['lava-test-case', '"Linpack MFLOPS Single Score"', '--result', 'pass', '--measurement', mflops_single_score.getText(), '--units', 'MFLOPS'])
-call(['lava-test-case', '"Linpack Time Single Score"', '--result', 'pass', '--measurement', time_single_score.getText(), '--units', 'seconds'])
+call([f_output_result, 'LinpackMFLOPSSingleScore', 'pass', mflops_single_score.getText(), 'MFLOPS'])
+call([f_output_result, 'LinpackTimeSingleScore', 'pass', time_single_score.getText(), 'seconds'])
start_multi_button = vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/btncalculate")
start_multi_button.touch()
@@ -42,5 +45,5 @@ while not start_single_button:
mflops_multi_score = vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txtmflops_result")
time_multi_score = vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txttime_result")
-call(['lava-test-case', '"Linpack MFLOPS Multi Score"', '--result', 'pass', '--measurement', mflops_multi_score.getText(), '--units', 'MFLOPS'])
-call(['lava-test-case', '"Linpack Time Multi Score"', '--result', 'pass', '--measurement', time_multi_score.getText(), '--units', 'seconds'])
+call([f_output_result, 'LinpackMFLOPSMultiScore', 'pass', mflops_multi_score.getText(), 'MFLOPS'])
+call([f_output_result, 'LinpackTimeMultiScore', 'pass', time_multi_score.getText(), 'seconds'])
diff --git a/linpackjava/vc.py b/linpackjava/vc.py
index 8db6640..234f5fd 100644
--- a/linpackjava/vc.py
+++ b/linpackjava/vc.py
@@ -6,6 +6,9 @@ from subprocess import call
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException
+parent_dir = os.path.realpath(os.path.dirname(__file__))
+f_output_result="%s/../common/output-test-result.sh" % parent_dir
+
kwargs1 = {'verbose': False, 'ignoresecuredevice': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': False}
@@ -28,7 +31,7 @@ while(not finished):
print "benchmark finished"
speed = res_match.group('measurement').strip()
print "%s=%s MFLOPS" % ("LinpackJavaSpeed", speed)
- call(['lava-test-case', "LinpackJavaSpeed", '--result', 'pass', '--measurement', speed, '--units', 'MFLOPS'])
+ call([f_output_result, "LinpackJavaSpeed", 'pass', speed, 'MFLOPS'])
except ViewNotFoundException:
pass
except RuntimeError:
diff --git a/scimark/vc.py b/scimark/vc.py
index 40f1d0a..a8a7eb9 100644
--- a/scimark/vc.py
+++ b/scimark/vc.py
@@ -6,12 +6,16 @@ from subprocess import call
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException
+parent_dir = os.path.realpath(os.path.dirname(__file__))
+f_output_result="%s/../common/output-test-result.sh" % parent_dir
+
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)
-vc.dump()
+time.sleep(5)
+vc.dump()
btn_java_bench = vc.findViewWithTextOrRaise(u'Java bench')
btn_java_bench.touch()
@@ -32,7 +36,7 @@ while(not finished):
if key_val[0].strip() in keys:
key = key_val[0].strip().replace(' ', '_').replace('(', '').replace(')', '').replace(',', '')
print "%s=%s" % (key, key_val[1].strip())
- call(['lava-test-case', key, '--result', 'pass', '--measurement', key_val[1].strip(), '--units', 'Mflops'])
+ call([f_output_result, key, 'pass', key_val[1].strip(), 'Mflops'])
except ViewNotFoundException:
pass
except RuntimeError:
diff --git a/smartbench2012/execute.sh b/smartbench2012/execute.sh
index 6b0025c..fa5c96a 100755
--- a/smartbench2012/execute.sh
+++ b/smartbench2012/execute.sh
@@ -7,7 +7,7 @@ test_method="python vc.py"
apk_package="com.smartbench.twelve"
#following should no need to modify
-parent_dir=`dirname ${0}`
+parent_dir=$(cd $(dirname ${0});pwd)
source "${parent_dir}/../common/common.sh"
post_uninstall="${parent_dir}/extract_results.sh"
main "$@"
diff --git a/smartbench2012/extract_results.sh b/smartbench2012/extract_results.sh
index e5b7e6f..14bed84 100755
--- a/smartbench2012/extract_results.sh
+++ b/smartbench2012/extract_results.sh
@@ -2,9 +2,10 @@
local_this_parent="$(cd $(dirname $0);pwd)"
source "${local_this_parent}/../common/common.sh"
+source "${local_this_parent}/../common/statistic_average.sh"
SCORE=`awk -F'[][]' '/SBGlobal.nProductivityIndex/{k=$2}END{print k}' ${F_LOGCAT}`
UNIT="points"
echo "Score is: $SCORE"
-lava-test-case SmartbenchScore --result pass --measurement $SCORE --units $UNIT
+output_test_result SmartbenchScore pass $SCORE $UNIT
diff --git a/smartbench2012/vc.py b/smartbench2012/vc.py
index 0af611e..0211596 100755
--- a/smartbench2012/vc.py
+++ b/smartbench2012/vc.py
@@ -20,27 +20,31 @@ kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': Fal
vc = ViewClient(device, serialno, **kwargs2)
while True:
try:
+ time.sleep(5)
vc.dump('-1')
btn_start = vc.findViewWithTextOrRaise("Run SmartBench")
btn_start.touch()
break
+ except ViewNotFoundException:
+ pass
except RuntimeError:
pass
except ValueError:
pass
finished = False
-btn_results = None
-while(not finished):
+while not finished:
try:
time.sleep(5)
vc.dump('-1')
- btn_results = vc.findViewWithText("Display Index Scores")
- if btn_results:
- finished = True
+ btn_results = vc.findViewWithTextOrRaise("Display Index Scores")
+ btn_results.touch()
+ time.sleep(3)
+ print "benchmark finished"
+ finished = True
+ except ViewNotFoundException:
+ pass
except RuntimeError:
pass
except ValueError:
pass
-print "benchmark finished"
-btn_results.touch()