[pixman/src/check-config.sh] Test that all source files #include <config.h>

as their first include.
This commit is contained in:
Behdad Esfahbod 2007-04-03 20:30:30 -04:00
parent 8fbf50d31d
commit a1287e483c
3 changed files with 21 additions and 1 deletions

View file

@ -38,3 +38,6 @@ libpixman_mmx_la_SOURCES = \
libpixman_mmx_la_CFLAGS = $(PIXMAN_CFLAGS)
libpixman_la_LIBADD = libpixman-mmx.la
endif
TESTS = check-config.sh
EXTRA_DIST = $(TESTS)

17
pixman/src/check-config.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
LANG=C
test -z "$srcdir" && srcdir=.
status=0
echo 'Checking source files for missing or misplaced #include <config.h>'
find "$srcdir" -name '*.c' -or -name '*.cpp' |
while read x; do
grep '\<include\>' "$x" /dev/null | head -n 1
done |
grep -v '<config.h>' |
grep . && status = 1
exit $status

View file

@ -9,7 +9,7 @@ echo 'Checking source files for missing or misplaced #include "cairoint.h"'
find "$srcdir" -name '*.c' -or -name '*.cpp' |
while read x; do
grep 'include' "$x" /dev/null | head -n 1
grep '\<include\>' "$x" /dev/null | head -n 1
done |
grep -v '"cairoint.h"' |
grep . && status = 1