summaryrefslogtreecommitdiff
path: root/automated/android/apk-automation/scimark.py
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-03-30 18:54:46 +0100
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-04-28 09:50:02 +0000
commitab48dcadc4eb74a126a8d76bece720ab000b1452 (patch)
tree4cf508236cf2cf8d44ff2552bf7b2d7a6fdee58b /automated/android/apk-automation/scimark.py
parentd92cc5a7e7461e7fe493a3a1be0bbdc7a94f9892 (diff)
downloadtest-definitions-pipe-ab48dcadc4eb74a126a8d76bece720ab000b1452.tar.gz
automated: android: add refactored apk-automation
Change-Id: I5a81b3c4317dc56f90df37c5a8f83d2547542fab Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'automated/android/apk-automation/scimark.py')
-rwxr-xr-xautomated/android/apk-automation/scimark.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/automated/android/apk-automation/scimark.py b/automated/android/apk-automation/scimark.py
new file mode 100755
index 0000000..bcc30d5
--- /dev/null
+++ b/automated/android/apk-automation/scimark.py
@@ -0,0 +1,46 @@
+import time
+from common import ApkTestRunner
+from com.dtmilano.android.viewclient import ViewNotFoundException
+
+
+class ApkRunnerImpl(ApkTestRunner):
+ def __init__(self, config):
+ self.config = config
+ self.config['apk_file_name'] = 'JavaBenchmark/non-pure-java-benchmarks/03-SciMark.apk'
+ self.config['apk_package'] = 'net.danielroggen.scimark'
+ self.config['activity'] = 'net.danielroggen.scimark/.ActivityMain'
+ super(ApkRunnerImpl, self).__init__(self.config)
+
+ def execute(self):
+ time.sleep(5)
+ self.dump_always()
+ btn_java_bench = self.vc.findViewWithTextOrRaise(u'Java bench')
+ btn_java_bench.touch()
+
+ finished = False
+ while not finished:
+ try:
+ time.sleep(60)
+ self.dump_always()
+ self.sci_results = self.vc.findViewByIdOrRaise("net.danielroggen.scimark:id/textViewResult")
+ if self.sci_results.getText().find("Done") > 0:
+ finished = True
+ self.logger.info("benchmark finished")
+ except ViewNotFoundException:
+ pass
+ except RuntimeError:
+ pass
+ except ValueError:
+ pass
+
+ def parseResult(self):
+ keys = ["FFT (1024)", "SOR (100x100)", "Monte Carlo",
+ "Sparse matmult (N=1000, nz=5000)", "LU (100x100)", "Composite Score"]
+
+ for line in self.sci_results.getText().replace(": \n", ":").split("\n"):
+ line = str(line.strip())
+ key_val = line.split(":")
+ if len(key_val) == 2:
+ if key_val[0].strip() in keys:
+ key = key_val[0].strip().replace(' ', '-').replace('(', '').replace(')', '').replace(',', '')
+ self.report_result("scimark-" + key, 'pass', key_val[1].strip(), 'Mflops')