diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2017-02-28 12:02:35 +0000 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2017-03-28 15:31:24 +0100 |
commit | addf62946d6c73885dd261099cddc06d3c910f17 (patch) | |
tree | 15abd81ea9caaeaa5add5be4fb27d119178f8e7a /src/compiler | |
parent | ee8aea35725e4b582ed8af2866d0feffa2d13c6e (diff) |
glcpp/tests/glcpp-test: set srcdir/abs_builddir variables
Current definitions work fine for the manual invokation of the script,
although the whole script does not consider that one can run it OOT.
The latter will be handled with latter patches, although it will be
extensively using the two variables.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Diffstat (limited to 'src/compiler')
-rwxr-xr-x | src/compiler/glsl/glcpp/tests/glcpp-test.sh | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/compiler/glsl/glcpp/tests/glcpp-test.sh b/src/compiler/glsl/glcpp/tests/glcpp-test.sh index 3945ee4f6c..3546a3e016 100755 --- a/src/compiler/glsl/glcpp/tests/glcpp-test.sh +++ b/src/compiler/glsl/glcpp/tests/glcpp-test.sh @@ -1,15 +1,22 @@ #!/bin/sh -if [ ! -z "$srcdir" ]; then - testdir=$srcdir/glsl/glcpp/tests - outdir=`pwd`/glsl/glcpp/tests - glcpp=`pwd`/glsl/glcpp/glcpp -else - testdir=. - outdir=. - glcpp=../glcpp +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 "" + + # Should point to `dirname Makefile.glsl.am` + srcdir=./../../../ + cd `dirname "$0"` + # Should point to `dirname Makefile` equivalent to the above. + abs_builddir=`pwd`/../../../ fi +testdir=$srcdir/glsl/glcpp/tests +outdir=$abs_builddir/glsl/glcpp/tests +glcpp=$abs_builddir/glsl/glcpp/glcpp + trap 'rm $test.valgrind-errors; exit 1' INT QUIT usage () |