diff options
author | Marc Bonnici <marc.bonnici@arm.com> | 2019-01-04 17:24:52 +0000 |
---|---|---|
committer | setrofim <setrofim@gmail.com> | 2019-02-08 13:56:55 +0000 |
commit | a1cecc0002f20c259bfc7dcd5cb5cd2c162560c1 (patch) | |
tree | 2b586f5d42872188c6cefd38f8fadaeb7ed8dd08 | |
parent | 0cba3c68dc9916da65484e07ee360ff2d3972780 (diff) |
fw/workload: Add "support_versions" attribute to workloads
Allow for specifying a list of supported APK versions for a workload. If
a specific version is no specified then attempt to a resolve any valid
version for the workload.
-rw-r--r-- | doc/source/api/workload.rst | 5 | ||||
-rw-r--r-- | wa/framework/workload.py | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/doc/source/api/workload.rst b/doc/source/api/workload.rst index 468516b8..f1494f5c 100644 --- a/doc/source/api/workload.rst +++ b/doc/source/api/workload.rst @@ -178,6 +178,11 @@ methods. locations) and device will be searched for an application with a matching package name. +``supported_versions`` + This attribute should be a list of apk versions that are suitable for this + workload, if a specific apk version is not specified then any available + supported version may be chosen. + ``view`` This is the "view" associated with the application. This is used by instruments like ``fps`` to monitor the current framerate being generated by diff --git a/wa/framework/workload.py b/wa/framework/workload.py index 8d57aeb3..e7408321 100644 --- a/wa/framework/workload.py +++ b/wa/framework/workload.py @@ -22,7 +22,7 @@ from wa.framework.plugin import TargetedPlugin, Parameter from wa.framework.resource import (ApkFile, ReventFile, File, loose_version_matching) from wa.framework.exception import WorkloadError, ConfigError -from wa.utils.types import ParameterDict +from wa.utils.types import ParameterDict, list_or_string from wa.utils.revent import ReventRecorder from wa.utils.exec_control import once_per_instance @@ -174,6 +174,7 @@ class ApkWorkload(Workload): # Times are in seconds loading_time = 10 package_names = [] + supported_versions = [] view = None clear_data_on_reset = True @@ -259,7 +260,7 @@ class ApkWorkload(Workload): package_name=self.package_name, variant=self.variant, strict=self.strict, - version=self.version, + version=self.version or self.supported_versions, force_install=self.force_install, install_timeout=self.install_timeout, uninstall=self.uninstall, @@ -758,8 +759,9 @@ class PackageHandler(object): matching_packages = [] for package in installed_versions: package_version = self.target.get_package_version(package) - if loose_version_matching(self.version, package_version): - matching_packages.append(package) + for v in list_or_string(self.version): + if loose_version_matching(v, package_version): + matching_packages.append(package) if len(matching_packages) == 1: self.package_name = matching_packages[0] elif len(matching_packages) > 1: |