mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 10:11:17 +00:00
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.
This commit is contained in:
parent
0cba3c68dc
commit
a1cecc0002
@ -178,6 +178,11 @@ methods.
|
|||||||
locations) and device will be searched for an application with a matching
|
locations) and device will be searched for an application with a matching
|
||||||
package name.
|
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``
|
``view``
|
||||||
This is the "view" associated with the application. This is used by
|
This is the "view" associated with the application. This is used by
|
||||||
instruments like ``fps`` to monitor the current framerate being generated by
|
instruments like ``fps`` to monitor the current framerate being generated by
|
||||||
|
@ -22,7 +22,7 @@ from wa.framework.plugin import TargetedPlugin, Parameter
|
|||||||
from wa.framework.resource import (ApkFile, ReventFile,
|
from wa.framework.resource import (ApkFile, ReventFile,
|
||||||
File, loose_version_matching)
|
File, loose_version_matching)
|
||||||
from wa.framework.exception import WorkloadError, ConfigError
|
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.revent import ReventRecorder
|
||||||
from wa.utils.exec_control import once_per_instance
|
from wa.utils.exec_control import once_per_instance
|
||||||
|
|
||||||
@ -174,6 +174,7 @@ class ApkWorkload(Workload):
|
|||||||
# Times are in seconds
|
# Times are in seconds
|
||||||
loading_time = 10
|
loading_time = 10
|
||||||
package_names = []
|
package_names = []
|
||||||
|
supported_versions = []
|
||||||
view = None
|
view = None
|
||||||
clear_data_on_reset = True
|
clear_data_on_reset = True
|
||||||
|
|
||||||
@ -259,7 +260,7 @@ class ApkWorkload(Workload):
|
|||||||
package_name=self.package_name,
|
package_name=self.package_name,
|
||||||
variant=self.variant,
|
variant=self.variant,
|
||||||
strict=self.strict,
|
strict=self.strict,
|
||||||
version=self.version,
|
version=self.version or self.supported_versions,
|
||||||
force_install=self.force_install,
|
force_install=self.force_install,
|
||||||
install_timeout=self.install_timeout,
|
install_timeout=self.install_timeout,
|
||||||
uninstall=self.uninstall,
|
uninstall=self.uninstall,
|
||||||
@ -758,8 +759,9 @@ class PackageHandler(object):
|
|||||||
matching_packages = []
|
matching_packages = []
|
||||||
for package in installed_versions:
|
for package in installed_versions:
|
||||||
package_version = self.target.get_package_version(package)
|
package_version = self.target.get_package_version(package)
|
||||||
if loose_version_matching(self.version, package_version):
|
for v in list_or_string(self.version):
|
||||||
matching_packages.append(package)
|
if loose_version_matching(v, package_version):
|
||||||
|
matching_packages.append(package)
|
||||||
if len(matching_packages) == 1:
|
if len(matching_packages) == 1:
|
||||||
self.package_name = matching_packages[0]
|
self.package_name = matching_packages[0]
|
||||||
elif len(matching_packages) > 1:
|
elif len(matching_packages) > 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user