summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-02-26 21:06:07 +0000
committerEmil Velikov <[email protected]>2017-03-28 15:31:22 +0100
commit81ccc7a484ae8f9f242a42a80a3d09e6987cc816 (patch)
treef446d93bb5c9d3de547e282ac2fed0d1296490c4
parent4b366b171da2d77c92cef43833f50d4cf2427dcf (diff)
glsl/tests/warnings-test: add fallback srcdir/abs_builddir defines
There is no robust way to detect either one, so simply hope for the best and warn just in case. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
-rwxr-xr-xsrc/compiler/glsl/tests/warnings-test.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/compiler/glsl/tests/warnings-test.sh b/src/compiler/glsl/tests/warnings-test.sh
index b19e2fe5171..7891c2477fe 100755
--- a/src/compiler/glsl/tests/warnings-test.sh
+++ b/src/compiler/glsl/tests/warnings-test.sh
@@ -1,8 +1,21 @@
#!/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=./glsl_compiler
+compiler=$abs_builddir/glsl_compiler
total=0
pass=0