--------------------- PatchSet 6898 Date: 2008/02/19 21:50:00 Author: amosjeffries Branch: cleanup Tag: (none) Log: Optimize .h test script. - Only build/test headers which have not chanegd since last test TODO: check/add cleanup to 'make clean' to ensure the .o are removed on reconfigure or clean. Members: test-suite/testheaders.sh:1.1.2.2->1.1.2.3 Index: squid3/test-suite/testheaders.sh =================================================================== RCS file: /cvsroot/squid-sf//squid3/test-suite/Attic/testheaders.sh,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/test-suite/testheaders.sh 19 Feb 2008 11:36:46 -0000 1.1.2.2 +++ squid3/test-suite/testheaders.sh 19 Feb 2008 21:50:00 -0000 1.1.2.3 @@ -13,16 +13,19 @@ libs="$3" for f in `ls -1 *.h`; do - echo "Testing ${f} ..." - ( echo "/* This file is AUTOMATICALLY GENERATED. DO NOT ALTER IT */" - echo "#include \"${f}\" " - echo "int main( int argc, char* argv[] ) { return 0; } " - ) >./testHeaderDeps_${f/.h/}.cc + echo -n "Testing ${f} ..." + if [ ${f} -nt ./testHeaderDeps_${f/.h/}.o ]; then + ( echo "/* This file is AUTOMATICALLY GENERATED. DO NOT ALTER IT */" + echo "#include \"${f}\" " + echo "int main( int argc, char* argv[] ) { return 0; } " + ) >./testHeaderDeps_${f/.h/}.cc - # run compile test on the new file. - # DEBUG: -echo "TRY: ${cc} -o testHeaderDeps.o ${flags} ./testHeaderDeps_${f/.h/}.cc ${libs}" - ${cc} -o testHeaderDeps.o ${flags} ./testHeaderDeps_${f/.h/}.cc ${libs} || exit 1 + # run compile test on the new file. + # DEBUG: echo "TRY: ${cc} -o testHeaderDeps.o ${flags} ./testHeaderDeps_${f/.h/}.cc ${libs}" + ${cc} -o testHeaderDeps_${f/.h/}.o ${flags} ./testHeaderDeps_${f/.h/}.cc ${libs} || exit 1 + rm ./testHeaderDeps_${f/.h/}.cc + fi + echo "OK." done # remove the test temporary files