glsl/tests/optimisation-test: make sure that $PYTHON2 is set/available
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 23 Feb 2017 13:15:42 +0000 (13:15 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 28 Mar 2017 14:31:23 +0000 (15:31 +0100)
Otherwise we'll fail when invoking the script outside of "make check"

v2: use -ne over a string comparison (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/compiler/glsl/tests/optimization-test.sh

index dc9740f69f4e4c52232f90cca51778fbb0f32fa2..7410db64f147c1e1ea746903e9deb239f2cd03bd 100755 (executable)
@@ -6,6 +6,16 @@ else
    compare_ir=./compare_ir.py
 fi
 
+if [ -z "$PYTHON2" ]; then
+    PYTHON2=python2
+fi
+
+which $PYTHON2 >/dev/null
+if [ $? -ne 0 ]; then
+    echo "Could not find python2. Make sure that PYTHON2 variable is correctly set."
+    exit 1
+fi
+
 total=0
 pass=0