summaryrefslogtreecommitdiff
path: root/automated/android/apk-automation/linpack.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/linpack.py
parentd92cc5a7e7461e7fe493a3a1be0bbdc7a94f9892 (diff)
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/linpack.py')
-rwxr-xr-xautomated/android/apk-automation/linpack.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/automated/android/apk-automation/linpack.py b/automated/android/apk-automation/linpack.py
new file mode 100755
index 0000000..d71687f
--- /dev/null
+++ b/automated/android/apk-automation/linpack.py
@@ -0,0 +1,54 @@
+import time
+from common import ApkTestRunner
+
+
+class ApkRunnerImpl(ApkTestRunner):
+ def __init__(self, config):
+ self.config = config
+ self.config['apk_file_name'] = "com.greenecomputing.linpack-1.apk"
+ self.config['apk_package'] = "com.greenecomputing.linpack"
+ self.config['activity'] = "com.greenecomputing.linpack/.Linpack"
+ super(ApkRunnerImpl, self).__init__(self.config)
+
+ def execute(self):
+ # single core test.
+ time.sleep(2)
+ self.dump_always()
+ start_single_button = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/btnsingle")
+ start_single_button.touch()
+
+ time.sleep(2)
+ self.dump_always()
+ start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
+
+ while not start_single_button:
+ time.sleep(2)
+ self.dump_always()
+ start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
+
+ mflops_single_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txtmflops_result")
+ time_single_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txttime_result")
+ self.report_result('Linpack-MFLOPSSingleScore', 'pass', mflops_single_score.getText(), 'MFLOPS')
+ self.report_result('Linpack-TimeSingleScore', 'pass', time_single_score.getText(), 'seconds')
+
+ # Multi core test.
+ self.dump_always()
+ start_multi_button = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/btncalculate")
+ start_multi_button.touch()
+
+ time.sleep(2)
+ self.dump_always()
+ start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
+
+ while not start_single_button:
+ time.sleep(2)
+ self.dump_always()
+ start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
+
+ mflops_multi_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txtmflops_result")
+ time_multi_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txttime_result")
+ self.report_result('Linpack-MFLOPSMultiScore', 'pass', mflops_multi_score.getText(), 'MFLOPS')
+ self.report_result('Linpack-TimeMultiScore', 'pass', time_multi_score.getText(), 'seconds')
+
+ def parseResult(self):
+ pass