summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests/warnings-test.sh
blob: b19e2fe517190dd52dc5ef79a135d48fb84d3aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

# Execute several shaders, and check that the InfoLog outcome is the expected.

compiler=./glsl_compiler
total=0
pass=0

if [ ! -x "$compiler" ]; then
    echo "Could not find glsl_compiler. Ensure that it is build via make check"
    exit 1
fi

echo "====== Testing compilation output ======"
for test in `find . -iname '*.vert'`; do
    echo -n "Testing $test..."
    $compiler --just-log --version 150 "$test" > "$test.out" 2>&1
    total=$((total+1))
    if diff "$test.expected" "$test.out" >/dev/null 2>&1; then
        echo "PASS"
        pass=$((pass+1))
    else
        echo "FAIL"
        diff "$test.expected" "$test.out"
    fi
done

echo ""
echo "$pass/$total tests returned correct results"
echo ""

if [ $pass = $total ]; then
    exit 0
else
    exit 1
fi