summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-03-20 21:09:12 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-03-27 13:11:22 +0000
commitebce5ab5a68fd829cb2a545e006663a99c53b065 (patch)
tree6970959f27e92d96b99a2671767e5f96e38288a2 /automated
parentcf7a1b1230e947d5a07e7b52c5c2b0b1d4240a55 (diff)
downloadtest-definitions-pipe-ebce5ab5a68fd829cb2a545e006663a99c53b065.tar.gz
automated: android: add stringbench test
Change-Id: Iadb21d6f75c5b40a614d5f29d697933286e78808 Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/android/stringbench/stringbench.sh56
-rw-r--r--automated/android/stringbench/stringbench.yaml30
2 files changed, 86 insertions, 0 deletions
diff --git a/automated/android/stringbench/stringbench.sh b/automated/android/stringbench/stringbench.sh
new file mode 100755
index 0000000..95a1ccb
--- /dev/null
+++ b/automated/android/stringbench/stringbench.sh
@@ -0,0 +1,56 @@
+#!/bin/sh -ex
+
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
+ANDROID_SERIAL=""
+BOOT_TIMEOUT="300"
+
+usage() {
+ echo "Usage: $0 [-s <android_serial>] [-t <boot_timeout>]" 1>&2
+ exit 1
+}
+
+while getopts ":s:t:" o; do
+ case "$o" in
+ # Specify device serial number when more than one device connected.
+ s) ANDROID_SERIAL="${OPTARG}" ;;
+ t) BOOT_TIMEOUT="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+
+# shellcheck disable=SC1091
+. ../../lib/sh-test-lib
+# shellcheck disable=SC1091
+. ../../lib/android-test-lib
+
+initialize_adb
+wait_boot_completed "${BOOT_TIMEOUT}"
+create_out_dir "${OUTPUT}"
+
+parser() {
+ logfile="$1"
+ case "$2" in
+ stringbench) prefix="32bit" ;;
+ stringbench64) prefix="64bit" ;;
+ esac
+
+ while read -r line; do
+ test_case_id=$(echo "${line}" | cut -d: -f1 | tr -c '[:alnum:]:.' '_' | tr -s '_' | sed 's/_$//')
+ test_case_id="${prefix}_${test_case_id}"
+ measurement=$(echo "${line}" | awk '{print $(NF-1)}')
+ units=$(echo "${line}" | awk '{print $NF}')
+ add_metric "${test_case_id}" "pass" "${measurement}" "${units}"
+ done < "${logfile}"
+}
+
+for test in stringbench stringbench64; do
+ info_msg "device-${ANDROID_SERIAL}: About to run ${test}"
+ if ! adb_shell_which "${test}"; then
+ report_fail "check-${test}-existence"
+ exit 0
+ fi
+ adb shell "${test}" | tee "${OUTPUT}/${test}.log"
+ parser "${OUTPUT}/${test}.log" "${test}"
+done
diff --git a/automated/android/stringbench/stringbench.yaml b/automated/android/stringbench/stringbench.yaml
new file mode 100644
index 0000000..ec58bce
--- /dev/null
+++ b/automated/android/stringbench/stringbench.yaml
@@ -0,0 +1,30 @@
+metadata:
+ name: stringbench
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Run stringbench command to benchmark the performance of
+ string relevant feature of bionic. In the feature this test
+ should be upstream to bionic-benchmarks.
+ The source can be viewed here:
+ https://android-git.linaro.org/git/platform/external/stringbench.git"
+ maintainer:
+ - yongqin.liu@linaro.org
+ - chase.qi@linaro.org
+ os:
+ - android
+ scope:
+ - performance
+ devices:
+ - juno
+ - hi6220-hikey
+
+params:
+ # Specify device serial no. when more than one device connected.
+ ANDROID_SERIAL: ""
+ # Specify timeout in seconds for wait_boot_completed
+ BOOT_TIMEOUT: "300"
+
+run:
+ steps:
+ - cd ./automated/android/stringbench
+ - ./stringbench.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}"
+ - ../../utils/send-to-lava.sh ./output/result.txt