commit 26ba032907d5132a3aaa62b701dc2f4b024b9f47
Author: harigollamudi <harigopal.gollamudi@linaro.org>
Date:   Wed Mar 20 14:36:10 2013 +0530

    migrating 0xbench script for lava_test_shell

diff --git a/android/0xbench.yaml b/android/0xbench.yaml
new file mode 100644
index 0000000..f7e3f72
--- /dev/null
+++ b/android/0xbench.yaml
@@ -0,0 +1,11 @@
+metadata:
+    format: Lava-Test Test Definition 1.0
+    name: 0xbench
+    description: "0xbench test for android."
+
+run:
+    steps:
+        - "./android/scripts/0xbench.sh"
+
+parse:
+    pattern: "^(?P<test_case_id>*?)\\s+(?P<measurement>[\\d.]+)\\s+(?P<units>\\S+)\\s+(?P<result>(pass|fail))\\s*$
diff --git a/android/scripts/0xbench.sh b/android/scripts/0xbench.sh
new file mode 100644
index 0000000..af1c083
--- /dev/null
+++ b/android/scripts/0xbench.sh
@@ -0,0 +1,100 @@
+#!/system/bin/sh
+#
+# 0xbench test.
+#
+# Copyright (C) 2012, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51	 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+# owner: harigopal.gollamudi@linaro.org
+
+
+#######################################android_0xbenchmark_kill.py
+
+pid=`ps |grep org.zeroxlab.zeroxbenchmark|tr -s " "|cut -d' ' -f2`
+echo $pid
+kill $pid
+rm -rf /data/data/org.zeroxlab.zeroxbenchmark/files*
+rm -rf /data/data/org.zeroxlab.zeroxbenchmark/shared_prefs*
+
+########################################android_0xbenchmark_modify_path.py
+
+source=$PWD/ZeroxBench_Preference.xml
+target="/data/data/org.zeroxlab.zeroxbenchmark/shared_prefs/ZeroxBench_Preference.xml"
+
+target_dir="/data/data"
+
+group="None"
+owner="None"
+
+group=`ls -l /data/data/|grep org.zeroxlab.zeroxbenchmark|tr -s " "|cut -d \  -f 2`
+owner=`ls -l /data/data/|grep org.zeroxlab.zeroxbenchmark|tr -s " "|cut -d \  -f 3`
+
+
+echo group:$group
+echo owner:$owner
+
+target_dir="/data/data/org.zeroxlab.zeroxbenchmark/shared_prefs"
+
+
+#make dir
+mkdir $target_dir
+echo "directory created"
+#change owner
+chown $owner:$group $target_dir
+echo "owner changed"
+#change mode
+chmod 771 $target_dir
+echo "mode changed"
+#push file
+cp $source $target
+#change owner
+chown $owner:$group $target
+#change mode
+chmod 660 $target
+
+target_dir="/data/data/org.zeroxlab.zeroxbenchmark/files"
+
+#make dir
+mkdir $target_dir
+#change owner
+chown $owner:$group $target_dir
+#change mode
+chmod 771 $target_dir
+
+########################################0xbench.py
+
+
+save_dir="/data/data/org.zeroxlab.zeroxbenchmark/files"
+
+#options to come from app which runs activity manager
+
+logcat -c
+
+am start -n org.zeroxlab.zeroxbenchmark/org.zeroxlab.zeroxbenchmark.Benchmark --ez autorun true --ez math true --ez 2d true 
+
+
+########################################
+
+while [ ! -f /data/data/org.zeroxlab.zeroxbenchmark/files/0xBenchmark.bundle ]
+do
+  sleep 2
+done
+cp /data/data/org.zeroxlab.zeroxbenchmark/files/0xBenchmark.bundle /mnt/sdcard/0xBenchmark.bundle
+
+
+logcat -d | grep "0xbench_test_case:" |tr -s " "|cut -d \  -f 4,5,6,7,8
+
+
+
diff --git a/android/scripts/ZeroxBench_Preference.xml b/android/scripts/ZeroxBench_Preference.xml
new file mode 100644
index 0000000..6f07a12
--- /dev/null
+++ b/android/scripts/ZeroxBench_Preference.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<map>
+<string name="KEY_RESULT_CUSTOM_DIR">/data/data/org.zeroxlab.zeroxbenchmark/files</string>
+<int name="KEY_RESULT_SELECTION" value="1" />
+</map>
