]>
git.ipfire.org Git - thirdparty/squid.git/blob - test-suite/testheaders.sh
3 # test all header files (.h) for dependancy issues.
5 # Ideally this test should be performed twice before any code is accepted.
6 # With or without inline enabled. This is needed because the .cci files
7 # are only included into the .h files when inline mode is enabled.
9 # This script should be run from the makefile with the directory path and ccflags
13 if test "${2}" = ""; then
21 for f
in `cd ${dir} && ls -1 *.h 2>/dev/null`; do
22 echo -n "Testing ${dir}/${f} ..."
23 hdr
=`echo "${f}" | sed s/.h//`
24 if [ ! -e .
/testHeaderDeps_
${hdr}.o -o ${dir}/${f} -nt ./testHeaderDeps_${hdr}.o
]; then
25 ( echo "/* This file is AUTOMATICALLY GENERATED. DO NOT ALTER IT */"
26 echo "#include \"${dir}/${f}\" "
27 echo "int main( int argc, char* argv[] ) { return 0; } "
28 ) >.
/testHeaderDeps_
${hdr}.cc
30 # run compile test on the new file.
31 # DEBUG: echo "TRY: ${cc} -o testHeaderDeps.o ./testHeaderDeps_${hdr}.cc"
32 ${cc} -c -o testHeaderDeps_${hdr}.o ./testHeaderDeps_${hdr}.cc
33 rm .
/testHeaderDeps_
${hdr}.cc
35 if [ ! -f testHeaderDeps_
${hdr}.o
]; then
40 # unit-tests require an app to run.
41 # our most-recent object suits this purpose.
42 # let's link or some tests will fail
43 ${cc} .
/testHeaderDeps_
${hdr}.o
-o .
/testHeaders