Improve check-includes.sh
This commit is contained in:
parent
381f2fb5e6
commit
d3490761e1
|
@ -10,12 +10,10 @@ test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb*
|
|||
test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb-*.cc' -or -name 'hb-*.hh'`
|
||||
|
||||
|
||||
cd "$srcdir"
|
||||
|
||||
|
||||
echo 'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)'
|
||||
|
||||
for x in $HBHEADERS; do
|
||||
test -f "$srcdir/$x" && x="$srcdir/$x"
|
||||
grep '#.*\<include\>' "$x" /dev/null | head -n 1
|
||||
done |
|
||||
grep -v '"hb-common[.]h"' |
|
||||
|
@ -28,6 +26,7 @@ grep . >&2 && stat=1
|
|||
echo 'Checking that source files #include "hb-*private.hh" first (or none)'
|
||||
|
||||
for x in $HBSOURCES; do
|
||||
test -f "$srcdir/$x" && x="$srcdir/$x"
|
||||
grep '#.*\<include\>' "$x" /dev/null | head -n 1
|
||||
done |
|
||||
grep -v '"hb-.*private[.]hh"' |
|
||||
|
@ -36,7 +35,10 @@ grep . >&2 && stat=1
|
|||
|
||||
|
||||
echo 'Checking that there is no #include <hb.*.h>'
|
||||
grep '#.*\<include\>.*<.*hb' $HBHEADERS $HBSOURCES >&2 && stat=1
|
||||
for x in $HBHEADERS $HBSOURCES; do
|
||||
test -f "$srcdir/$x" && x="$srcdir/$x"
|
||||
grep '#.*\<include\>.*<.*hb' "$x" /dev/null >&2 && stat=1
|
||||
done
|
||||
|
||||
|
||||
exit $stat
|
||||
|
|
Loading…
Reference in New Issue