• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2
3# Execute several shaders, and check that the InfoLog outcome is the expected.
4
5compiler=./glsl_compiler
6total=0
7pass=0
8
9echo "====== Testing compilation output ======"
10for 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
21done
22
23echo ""
24echo "$pass/$total tests returned correct results"
25echo ""
26
27if [[ $pass == $total ]]; then
28    exit 0
29else
30    exit 1
31fi
32