summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-03-29 14:44:30 +0800
committerChase Qi <chase.qi@linaro.org>2017-03-29 14:44:30 +0800
commit88a6f3629d9f22b3d61d6522aa2fb2cd046dff5b (patch)
tree4982c1bf9f4b4209d147050b4f28643be071293d
parent398778587abb3419f561439e7d073cca50f3b1a1 (diff)
automated: android: migrate piglit-gles3
Change-Id: Ic5c54730504baaa83547bd3c29e27b6e8da14011 Signed-off-by: Chase Qi <chase.qi@linaro.org>
-rwxr-xr-xautomated/android/piglit-gles3/device-script.sh70
-rwxr-xr-xautomated/android/piglit-gles3/piglit-gles3.sh24
-rw-r--r--automated/android/piglit-gles3/piglit-gles3.yaml27
3 files changed, 121 insertions, 0 deletions
diff --git a/automated/android/piglit-gles3/device-script.sh b/automated/android/piglit-gles3/device-script.sh
new file mode 100755
index 0000000..e655d57
--- /dev/null
+++ b/automated/android/piglit-gles3/device-script.sh
@@ -0,0 +1,70 @@
+#!/system/bin/sh
+#
+# piglit gles3.0 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
+#
+###############################################################################
+
+PIGLIT_PLATFORM=android
+export PIGLIT_PLATFORM
+
+PSTRING='PIGLIT: {"result": "pass"'
+SSTRING='PIGLIT: {"result": "skip"'
+FSTRING='PIGLIT: {"result": "fail"'
+
+gles3_bin_dir=/system/xbin/piglit/piglit-spec-gles3
+
+normal_test(){
+ cmd="${gles3_bin_dir}/$1"
+ test_name="${1}"
+ RESULT=$(${cmd} -auto)
+ case $RESULT in
+ *"$PSTRING"*) echo "${test_name}: pass";;
+ *"$SSTRING"*) echo "${test_name}: skip";;
+ *"$FSTRING"*) echo "${test_name}: fail";;
+ *) echo "${test_name}: fail";;
+ esac
+}
+
+test_oes_compressed_etc2_texture_miptree_gles3(){
+ PIGLIT_SOURCE_DIR="/data/piglit"
+ export PIGLIT_SOURCE_DIR
+ cmd="${gles3_bin_dir}/oes_compressed_etc2_texture-miptree_gles3"
+ test_base_name="oes_compressed_etc2_texture-miptree_gles3"
+ formats="rgb8 srgb8 rgba8 srgb8-alpha8 r11 rg11 rgb8-punchthrough-alpha1 srgb8-punchthrough-alpha1"
+ for format in ${formats}; do
+ RESULT=$("${cmd}" "${format}" -auto)
+
+ test_name="${test_base_name}_${format}"
+ case $RESULT in
+ *"$PSTRING"*) echo "${test_name}: pass";;
+ *"$SSTRING"*) echo "${test_name}: skip";;
+ *"$FSTRING"*) echo "${test_name}: fail";;
+ *) echo "${test_name}: fail";;
+ esac
+
+ done
+
+}
+normal_test "drawarrays-vertexid_gles3"
+normal_test "minmax_gles3"
+normal_test "texture-immutable-levels_gles3"
+test_oes_compressed_etc2_texture_miptree_gles3
diff --git a/automated/android/piglit-gles3/piglit-gles3.sh b/automated/android/piglit-gles3/piglit-gles3.sh
new file mode 100755
index 0000000..f9d3b69
--- /dev/null
+++ b/automated/android/piglit-gles3/piglit-gles3.sh
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+# shellcheck disable=SC1091
+
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+LOGFILE="${OUTPUT}/piglit-gles3.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-gles3/"
+info_msg "device-${ANDROID_SERIAL}: About to run piglit-gles3..."
+adb shell "/data/local/tmp/piglit-gles3/device-script.sh 2>&1" | 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-gles3/piglit-gles3.yaml b/automated/android/piglit-gles3/piglit-gles3.yaml
new file mode 100644
index 0000000..43cc437
--- /dev/null
+++ b/automated/android/piglit-gles3/piglit-gles3.yaml
@@ -0,0 +1,27 @@
+metadata:
+ name: piglit-gles3
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Piglit is a collection of automated tests for OpenGL
+ implementations. piglit_gles3.0 runs OpenGL ES 3.0 tests."
+ 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-gles3
+ - ./piglit-gles3.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}"
+ - ../../utils/send-to-lava.sh ./output/result.txt