aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2013-03-10 20:55:55 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2013-03-10 20:55:55 +0800
commitdae8aad89fb099bbad361532797b33bde17749ed (patch)
tree486eaeda243a12fbe5f36de0d8920ce920dd9598
parentb2bf2599f96dba1e144fab1f99e3cdf4cdf36126 (diff)
downloadthirdparty-benchmarks-dae8aad89fb099bbad361532797b33bde17749ed.tar.gz
ALL: updated to be built with sdk download from goodle
BenchmarksTestCase.java: delete the use of getDisplaySizeDp function SettingsTestCase.java: delete the use of getDisplaySizeDp function others: update for building with sdk and some document Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--README28
-rwxr-xr-xbuild.sh27
-rw-r--r--build.xml92
-rw-r--r--local.properties10
-rw-r--r--project.properties14
-rw-r--r--src/org/linaro/SettingsTestCase.java10
-rw-r--r--src/org/linaro/benchmarks/BenchmarksTestCase.java32
7 files changed, 167 insertions, 46 deletions
diff --git a/README b/README
index b5b5c92..119870c 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
This project is used to run benchmark applications in:
-http://linaro-private.git.linaro.org/git/people/bhoj/benchmarks.git
+ssh://linaro-private.git.linaro.org/srv/linaro-private.git.linaro.org/people/yongqinliu/benchmark-apks.git
-1. steps to run the uiautomator script:
+1. Steps to build and run linaro.android.jar under the root of android source:
* have a fully built Android source tree
* build the test:
mmm external/thirdparty-benchmarks
@@ -11,11 +11,31 @@ http://linaro-private.git.linaro.org/git/people/bhoj/benchmarks.git
adb shell uiautomator runtest linaro.android.jar \
-c org.linaro.benchmarks.BenchmarksTestCase#${test_method}
-Steps to create new tests off it:
+2. Steps to build and run linaro.android.jar under the root of android source:
+* Download the android from http://developer.android.com/sdk/index.html
+* unpack the sdk to some place of your local. like /tmp/android-sdk-linux/
+* export the ANDROID_HOME environment variable. like:
+ export ANDROID_HOME=/tmp/android-sdk-linux/
+* install the ant command. like:
+ sudo apt-get install ant
+* build the test
+ ./build.sh
+* deploy the test:
+ adb push bin/thirdparty-benchmarks.jar /data/local/tmp/
+* run the test:
+ adb shell uiautomator runtest linaro.android.jar \
+ -c org.linaro.benchmarks.BenchmarksTestCase#${test_method}
+
+3. Steps to create new tests off it:
* open file src/org/linaro/benchmarks/BenchmarksTestCase.java
* add method like testLinpack
-2. steps to run the scripts in benchmarks-script directory
+4. steps to run the scripts in benchmarks-script directory
* checkout this git repository
* run command like "monkeyrunner benchmarks-script/antutu/run.py" for antutu test
+5. wiki for reference:
+ https://wiki.linaro.org/Platform/Android/AutomatedThirdPartyBenchmarks
+
+6. mail: linaro-android@linaro.org
+
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..5d531c5
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+if [ -z "$ANDROID_HOME" ]; then
+ echo "Please export the ANDORID_HOME environment variable as following:"
+ echo "export ANDORID_HOME=<sdk-path>"
+ exit 1
+fi
+
+if ! `which ant >&/dev/null`; then
+ echo "Please install the ant command which will be used for building the jar file"
+ exit 1
+fi
+
+parent=$(cd $(dirname $0);pwd)
+proj_name=`basename $parent`
+
+${ANDROID_HOME}/tools/android create uitest-project -n $proj_name -t 1 -p $parent
+if [ $? -ne 0 ]; then
+ echo "Failed to create the uitest-project with the source under this directory"
+ exit 1
+fi
+ant build
+if [ $? -ne 0 ]; then
+ echo "Failed to build the directory"
+ exit 1
+fi
+
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..e167056
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="thirdparty-benchmarks" default="help">
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked into
+ Version Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The ant.properties file can be created by you. It is only edited by the
+ 'android' tool to add properties to it.
+ This is the place to change some Ant specific build properties.
+ Here are some properties you may want to change/update:
+
+ source.dir
+ The name of the source directory. Default is 'src'.
+ out.dir
+ The name of the output directory. Default is 'bin'.
+
+ For other overridable properties, look at the beginning of the rules
+ files in the SDK, at tools/ant/build.xml
+
+ Properties related to the SDK location or the project target should
+ be updated using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems.
+
+ -->
+ <property file="ant.properties" />
+
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var.
+ This must be done before we load project.properties since
+ the proguard config can use sdk.dir -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
+ <!-- The project.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+
+ This contains project specific properties such as project target, and library
+ dependencies. Lower level build properties are stored in ant.properties
+ (or in .classpath for Eclipse projects).
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
+ <loadproperties srcFile="project.properties" />
+
+ <!-- quick check on sdk.dir -->
+ <fail
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
+ unless="sdk.dir"
+ />
+
+ <!--
+ Import per project custom build rules if present at the root of the project.
+ This is the place to put custom intermediary targets such as:
+ -pre-build
+ -pre-compile
+ -post-compile (This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir})
+ -post-package
+ -post-build
+ -pre-clean
+ -->
+ <import file="custom_rules.xml" optional="true" />
+
+ <!-- Import the actual build file.
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <import> task.
+ - customize it to your needs.
+ - Customize the whole content of build.xml
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, replacing the <import> task.
+ - customize to your needs.
+
+ ***********************
+ ****** IMPORTANT ******
+ ***********************
+ In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+ in order to avoid having your file be overridden by tools such as "android update project"
+ -->
+ <!-- version-tag: VERSION_TAG -->
+ <import file="${sdk.dir}/tools/ant/uibuild.xml" />
+
+</project>
diff --git a/local.properties b/local.properties
new file mode 100644
index 0000000..439249a
--- /dev/null
+++ b/local.properties
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must *NOT* be checked into Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk.dir=/tmp/wokspace/android-sdk-linux
diff --git a/project.properties b/project.properties
new file mode 100644
index 0000000..a3ee5ab
--- /dev/null
+++ b/project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-17
diff --git a/src/org/linaro/SettingsTestCase.java b/src/org/linaro/SettingsTestCase.java
index b9a9f22..918859f 100644
--- a/src/org/linaro/SettingsTestCase.java
+++ b/src/org/linaro/SettingsTestCase.java
@@ -12,7 +12,6 @@ package org.linaro;
import java.io.File;
import android.app.Activity;
-import android.graphics.Point;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
@@ -46,9 +45,6 @@ public class SettingsTestCase extends UiAutomatorTestCase {
public void testSetSleep30Minutes() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//application related
openSettingsApp();
UiScrollable settingsItem = new UiScrollable(new UiSelector()
@@ -67,9 +63,6 @@ public class SettingsTestCase extends UiAutomatorTestCase {
public void testSetScreenLockNone() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//application related
openSettingsApp();
UiScrollable settingsItem = new UiScrollable(new UiSelector()
@@ -85,9 +78,6 @@ public class SettingsTestCase extends UiAutomatorTestCase {
public void testSetStayAwake() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//application related
openSettingsApp();
UiScrollable settingsItem = new UiScrollable(new UiSelector()
diff --git a/src/org/linaro/benchmarks/BenchmarksTestCase.java b/src/org/linaro/benchmarks/BenchmarksTestCase.java
index 07205a3..0e95370 100644
--- a/src/org/linaro/benchmarks/BenchmarksTestCase.java
+++ b/src/org/linaro/benchmarks/BenchmarksTestCase.java
@@ -12,7 +12,6 @@ package org.linaro.benchmarks;
import java.io.File;
import android.app.Activity;
-import android.graphics.Point;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
@@ -74,9 +73,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testOrientationNatural() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//Application specific
getUiDevice().setOrientationNatural();
getUiDevice().freezeRotation();
@@ -88,9 +84,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testGeekbench() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//application related
UiSelector selector = new UiSelector();
UiObject btn_run = new UiObject(selector.text("Run Benchmarks")
@@ -123,9 +116,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testLinpack() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
UiSelector selector = new UiSelector();
UiObject btn_st = new UiObject(selector.text("Run Single Thread"));
btn_st.click();
@@ -141,11 +131,7 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testAntutu() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
UiSelector selector = new UiSelector();
- //
//click the Test test
UiObject text_scores = new UiObject(selector.text("Scores")
.className("android.widget.TextView"));
@@ -191,9 +177,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testCaffeine() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//Application specific
UiSelector selector = new UiSelector();
UiObject btn_run = new UiObject(selector.text("Run benchmark")
@@ -218,9 +201,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testAndEBench() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//Application specific
getUiDevice().setOrientationNatural();
UiSelector selector = new UiSelector();
@@ -253,9 +233,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testNBench() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//Application specific
getUiDevice().setOrientationNatural();
UiSelector selector = new UiSelector();
@@ -289,9 +266,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testQuadrant() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//Application specific
getUiDevice().setOrientationNatural();
UiSelector selector = new UiSelector();
@@ -338,9 +312,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testVellamo() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//Application specific
getUiDevice().setOrientationNatural();
UiSelector selector = new UiSelector();
@@ -400,9 +371,6 @@ public class BenchmarksTestCase extends UiAutomatorTestCase {
public void testGLBenchmark() throws Exception{
Bundle status = new Bundle();
status.putString("product", getUiDevice().getProductName());
- Point p = getUiDevice().getDisplaySizeDp();
- status.putInt("dp-width", p.x);
- status.putInt("dp-height", p.y);
//Application specific
getUiDevice().setOrientationNatural();
UiSelector selector = new UiSelector();