aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-02-23 14:27:08 +0000
committerEmil Velikov <[email protected]>2017-03-28 15:31:23 +0100
commit44b642225820a8372461a14e11df60afc5cc9289 (patch)
tree356da024e5ed89fdf2159c953d0e19db910cf77d
parent05bc5b35a7b57ca5c8be476b5c0c6ca2e59ef0ba (diff)
glsl/tests/optimization-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/optimization-test.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/glsl/tests/optimization-test.sh b/src/compiler/glsl/tests/optimization-test.sh
index 7410db64f14..a7d771170c5 100755
--- a/src/compiler/glsl/tests/optimization-test.sh
+++ b/src/compiler/glsl/tests/optimization-test.sh
@@ -16,6 +16,19 @@ if [ $? -ne 0 ]; then
exit 1
fi
+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 the folder two levels above glsl_test
+ abs_builddir=`pwd`/../../
+fi
+
total=0
pass=0