glsl/tests/warnings-test: error out if glsl_compiler is missing
[mesa.git] / src / compiler / glsl / tests / warnings-test.sh
1 #!/bin/sh
2
3 # Execute several shaders, and check that the InfoLog outcome is the expected.
4
5 compiler=./glsl_compiler
6 total=0
7 pass=0
8
9 if [ ! -x "$compiler" ]; then
10 echo "Could not find glsl_compiler. Ensure that it is build via make check"
11 exit 1
12 fi
13
14 echo "====== Testing compilation output ======"
15 for test in `find . -iname '*.vert'`; do
16 echo -n "Testing $test..."
17 $compiler --just-log --version 150 "$test" > "$test.out" 2>&1
18 total=$((total+1))
19 if diff "$test.expected" "$test.out" >/dev/null 2>&1; then
20 echo "PASS"
21 pass=$((pass+1))
22 else
23 echo "FAIL"
24 diff "$test.expected" "$test.out"
25 fi
26 done
27
28 echo ""
29 echo "$pass/$total tests returned correct results"
30 echo ""
31
32 if [ $pass = $total ]; then
33 exit 0
34 else
35 exit 1
36 fi