summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xautomated/android/piglit-shader-runner/device-script.sh55
-rwxr-xr-xautomated/android/piglit-shader-runner/piglit-shader-runner.sh24
-rw-r--r--automated/android/piglit-shader-runner/piglit-shader-runner.yaml27
3 files changed, 106 insertions, 0 deletions
diff --git a/automated/android/piglit-shader-runner/device-script.sh b/automated/android/piglit-shader-runner/device-script.sh
new file mode 100755
index 0000000..1d18f3b
--- /dev/null
+++ b/automated/android/piglit-shader-runner/device-script.sh
@@ -0,0 +1,55 @@
+#!/system/bin/sh
+#
+# piglit shader test.
+#
+# Copyright (C) 2014, 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: yongqin.liu@linaro.org
+#
+###############################################################################
+
+# find and loop over the shader tests found
+# recursively in the /data/piglit/shader directory
+
+PIGLIT_PLATFORM=android
+export PIGLIT_PLATFORM
+
+bin_path="/system/xbin/piglit/piglit-shader-test/shader_runner"
+data_dir="/data/piglit/shader"
+# glsl_es1_data_dir="${data_dir}/glsl-es-1.00/"
+# glsl_es3_data_dir="${data_dir}/glsl-es-3.00/"
+
+# shellcheck disable=SC2035
+/system/bin/busybox find ${data_dir} -name *.shader_test | while read -r file
+do
+ RESULT=$(${bin_path} "${file}" -auto )
+
+ PSTRING='PIGLIT: {"result": "pass"'
+ SSTRING='PIGLIT: {"result": "skip"'
+ FSTRING='PIGLIT: {"result": "fail"'
+
+ case $RESULT in
+ *"$PSTRING"*) echo "${file}: pass";;
+
+ *"$SSTRING"*) echo "${file}: skip";;
+
+ *"$FSTRING"*) echo "${file}: fail";;
+
+ *) echo "${file}: fail";;
+ esac
+done
diff --git a/automated/android/piglit-shader-runner/piglit-shader-runner.sh b/automated/android/piglit-shader-runner/piglit-shader-runner.sh
new file mode 100755
index 0000000..dd96165
--- /dev/null
+++ b/automated/android/piglit-shader-runner/piglit-shader-runner.sh
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+# shellcheck disable=SC1091
+
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+LOGFILE="${OUTPUT}/piglit-shader-runner.log"
+ANDROID_SERIAL=""
+BOOT_TIMEOUT="300"
+
+. ../../lib/sh-test-lib
+. ../../lib/android-test-lib
+
+parse_common_args "$@"
+initialize_adb
+wait_boot_completed "${BOOT_TIMEOUT}"
+create_out_dir "${OUTPUT}"
+
+adb_push "./device-script.sh" "/data/local/tmp/piglit-shader-runner/"
+info_msg "device-${ANDROID_SERIAL}: About to run piglit-shader-runner..."
+adb shell "echo /data/local/tmp/piglit-shader-runner/device-script.sh 2>&1 | su" | tee "${LOGFILE}"
+
+grep -E ".+: (pass|fail|skip)" "${LOGFILE}" \
+ | sed 's/://g' \
+ | awk '{printf("%s %s\n", $1, $2)}' >> "${RESULT_FILE}"
diff --git a/automated/android/piglit-shader-runner/piglit-shader-runner.yaml b/automated/android/piglit-shader-runner/piglit-shader-runner.yaml
new file mode 100644
index 0000000..42193ca
--- /dev/null
+++ b/automated/android/piglit-shader-runner/piglit-shader-runner.yaml
@@ -0,0 +1,27 @@
+metadata:
+ name: piglit-shader-runner
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Piglit shader_runner test suite for android. The test suite
+ runs shader tests using OpenGL shaders."
+ maintainer:
+ - yongqin.liu@linaro.org
+ - chase.qi@linaro.org
+ os:
+ - android
+ scope:
+ - functional
+ 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/piglit-shader-runner
+ - ./piglit-shader-runner.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}"
+ - ../../utils/send-to-lava.sh ./output/result.txt