summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2016-04-19 21:03:07 +0200
committerAlejandro Piñeiro <[email protected]>2016-05-26 09:19:17 +0200
commiteee00274fa330edfa536da039ba9116bdceb9990 (patch)
tree26ddd92e84022cc4966cdc0078a4b7da81502c58 /src/compiler/glsl/tests
parent68c23d2d046b6419c7b3bd273278235095e29dae (diff)
glsl: add warning-test
It executes compiler-glsl on all the available shaders, and it checks that the outcome is the expected. Bash code based on the already existing optimization-test v2: rebasing: use --version option Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/glsl/tests')
-rwxr-xr-xsrc/compiler/glsl/tests/warnings-test31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/compiler/glsl/tests/warnings-test b/src/compiler/glsl/tests/warnings-test
new file mode 100755
index 00000000000..1bea4665394
--- /dev/null
+++ b/src/compiler/glsl/tests/warnings-test
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Execute several shaders, and check that the InfoLog outcome is the expected.
+
+compiler=./glsl_compiler
+total=0
+pass=0
+
+echo "====== Testing compilation output ======"
+for test in `find . -iname '*.vert'`; do
+ echo -n "Testing $test..."
+ $compiler --just-log --version 150 "$test" > "$test.out" 2>&1
+ total=$((total+1))
+ if diff "$test.expected" "$test.out" >/dev/null 2>&1; then
+ echo "PASS"
+ pass=$((pass+1))
+ else
+ echo "FAIL"
+ diff "$test.expected" "$test.out"
+ fi
+done
+
+echo ""
+echo "$pass/$total tests returned correct results"
+echo ""
+
+if [[ $pass == $total ]]; then
+ exit 0
+else
+ exit 1
+fi