summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-03-29 15:00:34 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-03-30 09:17:04 +0000
commit795bf89345d962642cda45216fdb2987e45dd63c (patch)
tree4fff0a84219025d11abdcce00778b7b2fbf1b762 /automated
parent9d0276ec57b023501224ef5a0fedf394e07946de (diff)
automated: android: migrate piglit-glslparser
Change-Id: I481093354cdaeff06779eeb6accf7d8396cebdfc Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/android/piglit-glslparser/device-script.sh65
-rwxr-xr-xautomated/android/piglit-glslparser/piglit-glslparser.sh24
-rw-r--r--automated/android/piglit-glslparser/piglit-glslparser.yaml28
3 files changed, 117 insertions, 0 deletions
diff --git a/automated/android/piglit-glslparser/device-script.sh b/automated/android/piglit-glslparser/device-script.sh
new file mode 100755
index 0000000..c61ef5a
--- /dev/null
+++ b/automated/android/piglit-glslparser/device-script.sh
@@ -0,0 +1,65 @@
+#!/system/bin/sh
+#
+# piglit glslparser 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 vert and frag tests found
+# looks recursively down the directory tree
+PIGLIT_PLATFORM=android
+export PIGLIT_PLATFORM
+bin_path="/system/xbin/piglit/glslparsertest/glslparsertest"
+data_dir="/data/piglit/glslparser/"
+/system/bin/busybox find ${data_dir} -name "*.frag" -or -name "*.vert" | while read -r file
+do
+ RESULTFOUND=$(grep expect_result "${file}")
+ case $RESULTFOUND in
+ *fail*) RESULTEXPECTED="fail";;
+ *pass*) RESULTEXPECTED="pass";;
+ *) RESULTEXPECTED="pass";;
+ esac
+
+ check_link=$(grep check_link "${file}")
+ case "${check_link}" in
+ *true*) check_link="--check-link";;
+ *) check_link="";;
+ esac
+
+ required_version=$(grep 'glsl_version:' "${file}")
+ case "${check_link}" in
+ *3.00*) required_version="3.00";;
+ *) required_version="1.00";;
+ esac
+
+ RESULT=$("${bin_path}" "${check_link}" "${file}" "$RESULTEXPECTED" "${required_version}")
+
+ PSTRING='PIGLIT: {"result": "pass"'
+ SSTRING='PIGLIT: {"result": "skip"'
+ FSTRING='PIGLIT: {"result": "fail"'
+
+ case $RESULT in
+ *"$PSTRING"*) echo "glslparser ${file}: pass";;
+ *"$SSTRING"*) echo "glslparser ${file}: skip";;
+ *"$FSTRING"*) echo "glslparser ${file}: fail";;
+ *) echo "glslparser ${file}: fail";;
+ esac
+done
diff --git a/automated/android/piglit-glslparser/piglit-glslparser.sh b/automated/android/piglit-glslparser/piglit-glslparser.sh
new file mode 100755
index 0000000..1244927
--- /dev/null
+++ b/automated/android/piglit-glslparser/piglit-glslparser.sh
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+# shellcheck disable=SC1091
+
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+LOGFILE="${OUTPUT}/piglit-glslparser.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-glslparser/"
+info_msg "device-${ANDROID_SERIAL}: About to run piglit-glslparser..."
+adb shell "echo /data/local/tmp/piglit-glslparser/device-script.sh 2>&1 | su" | tee "${LOGFILE}"
+
+grep -E "glslparser /data/piglit/glslparser/.+: (pass|fail|skip)" "${LOGFILE}" \
+ | sed 's/://g' \
+ | awk '{printf("%s %s\n", $2, $3)}' >> "${RESULT_FILE}"
diff --git a/automated/android/piglit-glslparser/piglit-glslparser.yaml b/automated/android/piglit-glslparser/piglit-glslparser.yaml
new file mode 100644
index 0000000..c5bad20
--- /dev/null
+++ b/automated/android/piglit-glslparser/piglit-glslparser.yaml
@@ -0,0 +1,28 @@
+metadata:
+ name: piglit-glslparser
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "piglit glslparser test for android. The GLSL Parser provides
+ a front end for parsing and operating on OpenGL Shading
+ Language code. "
+ 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-glslparser
+ - ./piglit-glslparser.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}"
+ - ../../utils/send-to-lava.sh ./output/result.txt