mesa/tests/glcpp-test
Carl Worth baa17c8748 Remove blank lines from output files before comparing.
Recently I'm seeing cases where "gcc -E" mysteriously omits blank
lines, (even though it prints the blank lines in other very similar
cases). Rather than trying to decipher and imitate this, just get rid
of the blank lines.

This approach with sed to kill the lines before the diff is better
than "diff -B" since when there is an actual difference, the presence
of blank lines won't make the diff harder to read.
2010-05-27 14:53:51 -07:00

11 lines
290 B
Bash
Executable file

#!/bin/sh
set -e
for test in *.c; do
echo "Testing $test"
../glcpp < $test > $test.glcpp
grep -v '^$' < $test.glcpp > $test.out || true
gcc -E $test -o $test.gcc
grep -v '^#' < $test.gcc | grep -v '^$' > $test.expected || true
diff -u $test.expected $test.out
done