2 # copyright (c) 2011 Emil Mikulic.
9 echo checking header dependencies...
10 # Except for the c-ify output, every header should bring in all of its
11 # dependencies, and be able to be included multiple times.
14 files
=`ls *.h | fgrep -v -e graphjs.h -e stylecss.h`
19 void test_hdr_do_nothing(void) { }
21 if ! gcc
-c $src 2>/dev
/null
; then
22 echo "${a}===> $f can't be included by itself${z}"
29 void test_hdr_do_nothing(void) { }
31 if ! gcc
-c $src 2>/dev
/null
; then
32 echo "${a}===> $f can't be included twice${z}"
44 defines
="(^|[^a-zA-Z_])($2)"
47 echo checking
$header users...
49 # Check that files expecting defines include it.
50 for file in `egrep -l "$defines" $files`; do
51 if ! fgrep
-q '#include "'$header'"' $file; then
52 echo "${a}===> $file should include $header${z}"
54 egrep --color=always
"$defines" $file
58 # And that others don't.
59 for file in `fgrep -l '#include "'$header'"' *.[ch]`; do
60 if ! egrep -q "$defines" $file; then
61 echo "${a}===> $file should not include $header${z}"
71 defines
=`grep \# config.h | cut -d# -f2 | cut -d' ' -f2 | tr '\n' '|' |
73 files
=`ls *.[ch] | fgrep -v config.h`
74 check_defines config.h
"$defines" "$files"
76 defines
=`sed -e 's/# \+/#/;' < cdefs.h | grep '#define' | cut -d' ' -f2 |
77 sed -e 's/(.\+/\\\\(/' | tr '\n' '|' | sed -e 's/|$//'`
78 files
=`ls *.[ch] | fgrep -v -e cdefs.h -e graphjs.h -e stylecss.h`
79 check_defines cdefs.h
"$defines" "$files"
83 # vim:set ts=2 sw=2 et: