1 #!/usr/bin/env bash 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 echo "====== Testing compilation output ======" 10 for test in `find . -iname '*.vert'`; do 11 echo -n "Testing $test..." 12 $compiler --just-log --version 150 "$test" > "$test.out" 2>&1 13 total=$((total+1)) 14 if diff "$test.expected" "$test.out" >/dev/null 2>&1; then 15 echo "PASS" 16 pass=$((pass+1)) 17 else 18 echo "FAIL" 19 diff "$test.expected" "$test.out" 20 fi 21 done 22 23 echo "" 24 echo "$pass/$total tests returned correct results" 25 echo "" 26 27 if [[ $pass == $total ]]; then 28 exit 0 29 else 30 exit 1 31 fi 32