summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests/warnings-test.sh
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-12-08 17:25:50 -0800
committerDylan Baker <dylan@pnwbakers.com>2018-04-18 09:03:57 -0700
commit3b52d29227397dfe28945fde0cc44cb8ec11d83a (patch)
tree5ccb4058edd6882ff593f6a5099f8a28aeafc712 /src/compiler/glsl/tests/warnings-test.sh
parent12a002a3a1cef9c86f36e289ce1f391991351b11 (diff)
glsl/tests: reimplement warnings-test in python
This reimplements the test in python with a shell script wrapper that allows autotools to continue to run the test without realizing that anything has changed. Using python has two advantages, first it's portable so this test can be run on windows as well as Linux since it just requires python, no more diff, pwd or sh. It's also no longer tied to autotools implementation details, like the environment variables $srcdir and $abs_builddir, though the autotools shell wrapper still uses those, which makes it possible to run the test in meson. v2: - Use $PYTHON2 in script to be consistent with other scripts in mesa Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/compiler/glsl/tests/warnings-test.sh')
-rwxr-xr-xsrc/compiler/glsl/tests/warnings-test.sh57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/compiler/glsl/tests/warnings-test.sh b/src/compiler/glsl/tests/warnings-test.sh
index d5dc3b5974f..09b6bb2fc98 100755
--- a/src/compiler/glsl/tests/warnings-test.sh
+++ b/src/compiler/glsl/tests/warnings-test.sh
@@ -1,58 +1,3 @@
#!/bin/sh
-if [ -z "$srcdir" -o -z "$abs_builddir" ]; then
- echo ""
- echo "Warning: you're invoking the script manually and things may fail."
- echo "Attempting to determine/set srcdir and abs_builddir variables."
- echo ""
-
- # Variable should point to the Makefile.glsl.am
- srcdir=./../../
- cd `dirname "$0"`
- # Variable should point to glsl_compiler
- abs_builddir=`pwd`/../../
-fi
-
-# Execute several shaders, and check that the InfoLog outcome is the expected.
-
-compiler=$abs_builddir/glsl_compiler
-total=0
-pass=0
-
-if [ ! -x "$compiler" ]; then
- echo "Could not find glsl_compiler. Ensure that it is build via make check"
- exit 1
-fi
-
-tests_relative_dir="glsl/tests/warnings"
-
-echo "====== Testing compilation output ======"
-for test in $srcdir/$tests_relative_dir/*.vert; do
- test_output="$abs_builddir/$tests_relative_dir/`basename $test`"
- mkdir -p $abs_builddir/$tests_relative_dir/
- echo -n "Testing `basename $test`..."
- $compiler --just-log --version 150 "$test" > "$test_output.out" 2>&1
- total=$((total+1))
- if diff "$test.expected" "$test_output.out" >/dev/null 2>&1; then
- echo "PASS"
- pass=$((pass+1))
- else
- echo "FAIL"
- diff "$test.expected" "$test_output.out"
- fi
-done
-
-if [ $total -eq 0 ]; then
- echo "Could not find any tests."
- exit 1
-fi
-
-echo ""
-echo "$pass/$total tests returned correct results"
-echo ""
-
-if [ $pass = $total ]; then
- exit 0
-else
- exit 1
-fi
+$PYTHON2 $srcdir/glsl/tests/warnings_test.py --glsl-compiler $abs_builddir/glsl_compiler --test-directory $srcdir/glsl/tests/warnings/