1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-22 04:49:00 +00:00

Merge pull request #313 from marcbonnici/glbenchmark

glbenchmark: Updated version numbers from X.X.X to X.X.
This commit is contained in:
setrofim 2016-12-14 16:42:52 +00:00 committed by GitHub
commit 6d999301f3
3 changed files with 10 additions and 10 deletions

View File

@ -57,14 +57,14 @@ class Glb(AndroidUiAutoBenchmark):
view = 'com.glbenchmark.glbenchmark27/com.glbenchmark.activities.GLBRender' view = 'com.glbenchmark.glbenchmark27/com.glbenchmark.activities.GLBRender'
packages = { packages = {
'2.7.0': 'com.glbenchmark.glbenchmark27', '2.7': 'com.glbenchmark.glbenchmark27',
'2.5.1': 'com.glbenchmark.glbenchmark25', '2.5': 'com.glbenchmark.glbenchmark25',
} }
# If usecase is not specified the default usecase is the first supported usecase alias # If usecase is not specified the default usecase is the first supported usecase alias
# for the specified version. # for the specified version.
supported_usecase_aliases = { supported_usecase_aliases = {
'2.7.0': ['t-rex', 'egypt'], '2.7': ['t-rex', 'egypt'],
'2.5.1': ['egypt-classic', 'egypt'], '2.5': ['egypt-classic', 'egypt'],
} }
default_iterations = 1 default_iterations = 1
@ -73,15 +73,15 @@ class Glb(AndroidUiAutoBenchmark):
regex = re.compile(r'GLBenchmark (metric|FPS): (.*)') regex = re.compile(r'GLBenchmark (metric|FPS): (.*)')
parameters = [ parameters = [
Parameter('version', default='2.7.0', allowed_values=['2.7.0', '2.5.1'], Parameter('version', default='2.7', allowed_values=['2.7', '2.5'],
description=('Specifies which version of the benchmark to run (different versions ' description=('Specifies which version of the benchmark to run (different versions '
'support different use cases).')), 'support different use cases).')),
Parameter('use_case', default=None, Parameter('use_case', default=None,
description="""Specifies which usecase to run, as listed in the benchmark menu; e.g. description="""Specifies which usecase to run, as listed in the benchmark menu; e.g.
``'GLBenchmark 2.5 Egypt HD'``. For convenience, two aliases are provided ``'GLBenchmark 2.5 Egypt HD'``. For convenience, two aliases are provided
for the most common use cases: ``'egypt'`` and ``'t-rex'``. These could for the most common use cases: ``'egypt'`` and ``'t-rex'``. These could
be use instead of the full use case title. For version ``'2.7.0'`` it defaults be use instead of the full use case title. For version ``'2.7'`` it defaults
to ``'t-rex'``, for version ``'2.5.1'`` it defaults to ``'egypt-classic'``. to ``'t-rex'``, for version ``'2.5'`` it defaults to ``'egypt-classic'``.
"""), """),
Parameter('variant', default='onscreen', Parameter('variant', default='onscreen',
description="""Specifies which variant of the use case to run, as listed in the benchmarks description="""Specifies which variant of the use case to run, as listed in the benchmarks

View File

@ -81,7 +81,7 @@ public class UiAutomation extends BaseUiAutomation {
UiObject useCaseText = new UiObject(selector.className("android.widget.TextView") UiObject useCaseText = new UiObject(selector.className("android.widget.TextView")
.text(useCase) .text(useCase)
); );
if (version.equals("2.7.0")){ if (version.equals("2.7")){
UiObject variantText = useCaseText.getFromParent(selector.className("android.widget.TextView") UiObject variantText = useCaseText.getFromParent(selector.className("android.widget.TextView")
.text(variant)); .text(variant));
int scrolls = 0; int scrolls = 0;
@ -94,7 +94,7 @@ public class UiAutomation extends BaseUiAutomation {
} }
variantText.click(); variantText.click();
} }
else if (version.equals("2.5.1")){ else if (version.equals("2.5")){
int scrolls = 0; int scrolls = 0;
while(!useCaseText.exists()) { while(!useCaseText.exists()) {
testList.scrollForward(); testList.scrollForward();
@ -123,7 +123,7 @@ public class UiAutomation extends BaseUiAutomation {
public void waitForResults(String version, String useCase, int timeout) throws Exception { public void waitForResults(String version, String useCase, int timeout) throws Exception {
UiSelector selector = new UiSelector(); UiSelector selector = new UiSelector();
UiObject results = null; UiObject results = null;
if (version.equals("2.7.0")) if (version.equals("2.7"))
results = new UiObject(selector.text("Results").className("android.widget.TextView")); results = new UiObject(selector.text("Results").className("android.widget.TextView"));
else else
results = new UiObject(selector.text(useCase).className("android.widget.TextView")); results = new UiObject(selector.text(useCase).className("android.widget.TextView"));