summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2015-02-23 22:47:57 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2015-02-25 13:47:02 +0000
commit80473a78c79ba98c561cf1963351f5391ce98cbc (patch)
treecf89b3face5037f5a2cc9ae0ac5e42461fc9a213
parent58599dbbd4b6cd77daaf7a76bf9ce8be8a03b32f (diff)
add tests for AndEBench 2014 version
Change-Id: I03c42278852bcda02d5b28941b6a8835cfb7e806 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-xandebench2014/execute.sh15
-rw-r--r--andebench2014/vc.py43
2 files changed, 58 insertions, 0 deletions
diff --git a/andebench2014/execute.sh b/andebench2014/execute.sh
new file mode 100755
index 0000000..1bb51ac
--- /dev/null
+++ b/andebench2014/execute.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+#need to be defined for different benchmark apks
+apk_package="com.eembc.coremark"
+activity="${apk_package}/.tabs"
+apk_file_name="02-AndEBench2014.apk"
+test_method="python vc.py"
+
+#following should no need to modify
+parent_dir=`dirname ${0}`
+source "${parent_dir}/../common/common.sh"
+
+base_url="http://testdata.validation.linaro.org/apks/JavaBenchmark/non-pure-java-benchmarks/"
+
+main "$@"
diff --git a/andebench2014/vc.py b/andebench2014/vc.py
new file mode 100644
index 0000000..b778db0
--- /dev/null
+++ b/andebench2014/vc.py
@@ -0,0 +1,43 @@
+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)
+vc.dump()
+
+btn_start_on = vc.findViewByIdOrRaise("com.eembc.coremark:id/btn_start_on")
+btn_start_on.touch()
+finished = False
+while(not finished):
+ try:
+ time.sleep(20)
+ vc.dump()
+ btn_close = vc.findViewById("com.eembc.coremark:id/btn_close")
+ if btn_close:
+ btn_close.touch()
+ continue
+
+ results = vc.findViewByIdOrRaise("com.eembc.coremark:id/cid")
+ if not results.getText().find("Running") > 0:
+ finished = True
+ print "benchmark finished"
+ result_re = re.compile("(?P<test_case_id>[a-zA-Z\s]+):\s(?P<measurement>\d+)", re.MULTILINE)
+ search_results = result_re.finditer(results.getText())
+ for result in search_results:
+ 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'])
+ except ViewNotFoundException:
+ pass
+ except RuntimeError:
+ pass
+ except ValueError:
+ pass