1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 18:21:14 +00:00

workloads/antutu: Allow for unsupported tests

Not all benchmarks are available on all phones and will report "Not
supported" To allow for this update the regexes and if not a valid score
set any unsupported results to 'NaN'
This commit is contained in:
Marc Bonnici 2018-03-13 17:13:33 +00:00 committed by setrofim
parent 811dfbe5af
commit 6742c5c8ad

View File

@ -14,24 +14,24 @@
# #
import re import re
from wa import ApkUiautoWorkload from wa import ApkUiautoWorkload, WorkloadError
class Antutu(ApkUiautoWorkload): class Antutu(ApkUiautoWorkload):
name = 'antutu' name = 'antutu'
package_names = ['com.antutu.ABenchMark'] package_names = ['com.antutu.ABenchMark']
regex_matches = [re.compile(r'CPU Maths Score ([\d.]+)'), regex_matches = [re.compile(r'CPU Maths Score (.+)'),
re.compile(r'CPU Common Score ([\d.]+)'), re.compile(r'CPU Common Score (.+)'),
re.compile(r'CPU Multi Score ([\d.]+)'), re.compile(r'CPU Multi Score (.+)'),
re.compile(r'GPU Marooned Score ([\d.]+)'), re.compile(r'GPU Marooned Score (.+)'),
re.compile(r'GPU Coastline Score ([\d.]+)'), re.compile(r'GPU Coastline Score (.+)'),
re.compile(r'GPU Refinery Score ([\d.]+)'), re.compile(r'GPU Refinery Score (.+)'),
re.compile(r'Data Security Score ([\d.]+)'), re.compile(r'Data Security Score (.+)'),
re.compile(r'Data Processing Score ([\d.]+)'), re.compile(r'Data Processing Score (.+)'),
re.compile(r'Image Processing Score ([\d.]+)'), re.compile(r'Image Processing Score (.+)'),
re.compile(r'User Experience Score ([\d.]+)'), re.compile(r'User Experience Score (.+)'),
re.compile(r'RAM Score ([\d.]+)'), re.compile(r'RAM Score (.+)'),
re.compile(r'ROM Score ([\d.]+)')] re.compile(r'ROM Score (.+)')]
description = ''' description = '''
Executes Antutu 3D, UX, CPU and Memory tests Executes Antutu 3D, UX, CPU and Memory tests
@ -51,11 +51,13 @@ class Antutu(ApkUiautoWorkload):
for regex in self.regex_matches: for regex in self.regex_matches:
match = regex.search(line) match = regex.search(line)
if match: if match:
result = float(match.group(1)) try:
result = float(match.group(1))
except ValueError:
result = 'NaN'
entry = regex.pattern.rsplit(None, 1)[0] entry = regex.pattern.rsplit(None, 1)[0]
context.add_metric(entry, result, lower_is_better=False) context.add_metric(entry, result, lower_is_better=False)
expected_results -= 1 expected_results -= 1
if expected_results > 0: if expected_results > 0:
msg = "The Antutu workload has failed. Expected {} scores, Detected {} scores." msg = "The Antutu workload has failed. Expected {} scores, Detected {} scores."
raise WorkloadError(msg.format(len(self.regex_matches), expected_results)) raise WorkloadError(msg.format(len(self.regex_matches), expected_results))