Validate desired test cases by ensuring the output of glcpp matches
the output of the gcc preprocessor, (ignoring any lines of the gcc
output beginning with '#').
Only one test case so far with a trivial #define.
glcpp-parse.h
*.o
*~
+tests/*.expected
+tests/*.gcc
+tests/*.out
glcpp-lex.c: glcpp-parse.h
+test:
+ @(cd tests; ./glcpp-test)
+
clean:
rm -f glcpp-lex.c glcpp-parse.c *.o *~
+ rm -f tests/*.out tests/*.gcc tests/*.expected
--- /dev/null
+#define foo 1
+foo
--- /dev/null
+#!/bin/sh
+
+for test in *.c; do
+ echo "Testing $test"
+ ../glcpp < $test > $test.out
+ gcc -E $test -o $test.gcc
+ grep -v '^#' < $test.gcc > $test.expected
+ diff -u $test.expected $test.out
+done