1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-02 11:22:41 +01:00

utils/types: Add version_tuple

Allow for `version_tuple` to be used more generically to enable
natural comparing of versions encoded as strings.
This commit is contained in:
Marc Bonnici
2019-06-28 11:58:41 +01:00
committed by setrofim
parent 8910234448
commit f46851a3b4
4 changed files with 12 additions and 8 deletions

View File

@@ -23,6 +23,7 @@ from collections import defaultdict
from wa import ApkUiautoWorkload, Parameter
from wa.framework.exception import ConfigError, WorkloadError
from wa.utils.misc import capitalize
from wa.utils.types import version_tuple
class Geekbench(ApkUiautoWorkload):
@@ -101,7 +102,7 @@ class Geekbench(ApkUiautoWorkload):
def update_output(self, context):
super(Geekbench, self).update_output(context)
if not self.disable_update_result:
major_version = versiontuple(self.version)[0]
major_version = version_tuple(self.version)[0]
update_method = getattr(self, 'update_result_{}'.format(major_version))
update_method(context)
@@ -367,7 +368,3 @@ class GeekbenchCorproate(Geekbench): # pylint: disable=too-many-ancestors
def namemify(basename, i):
return basename + (' {}'.format(i) if i else '')
def versiontuple(v):
return tuple(map(int, (v.split("."))))