]>
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 [ "${2}" == "" ]; then
19 for f
in `cd ${dir} && ls -1 *.h 2>/dev/null`; do
20 echo -n "Testing ${dir}/${f} ..."
21 if [[ "${f}" == "cf_gen_defines.h" ||
"${f}" == "cf_parser.h" ]]; then
25 if [ ${dir}/${f} -nt ./testHeaderDeps_${f/.h/}.o
]; then
26 ( echo "/* This file is AUTOMATICALLY GENERATED. DO NOT ALTER IT */"
27 echo "#include \"${dir}/${f}\" "
28 echo "int main( int argc, char* argv[] ) { return 0; } "
29 ) >.
/testHeaderDeps_
${f/.h/}.cc
31 # run compile test on the new file.
32 # DEBUG: echo "TRY: ${cc} -o testHeaderDeps.o ./testHeaderDeps_${f/.h/}.cc"
33 ${cc} -o testHeaderDeps_${f/.h/}.o ./testHeaderDeps_${f/.h/}.cc
34 rm .
/testHeaderDeps_
${f/.h/}.cc
36 if [ ! -f testHeaderDeps_
${f/.h/}.o
]; then
41 # unit-tests require an app to run.
42 # our most-recent object suits this purpose
43 cp .
/testHeaderDeps_
${f/.h/}.o .
/testHeaders