From: Amos Jeffries Date: Sun, 8 Mar 2009 10:57:37 +0000 (+1300) Subject: Bug 2613: test-builds.sh does not test what it claims to test X-Git-Tag: SQUID_3_2_0_1~1134 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc3d3d8c671a338d5992ab4aa6277aee11ca343c;p=thirdparty%2Fsquid.git Bug 2613: test-builds.sh does not test what it claims to test * Add report from worker level of testbed to show test being run * Alter test config path on case where ../ is added to tester location * rename dist variable to correct config (its the config file path) * remove some no longer relevant bashism --- diff --git a/test-builds.sh b/test-builds.sh index ac92755c20..b53080d892 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -45,18 +45,25 @@ buildtest() { if test -e $top/test-suite/buildtest.sh ; then $top/test-suite/buildtest.sh $opts elif test -e ../$top/test-suite/buildtest.sh ; then - ../$top/test-suite/buildtest.sh $opts + ../$top/test-suite/buildtest.sh ../$opts fi } 2>&1 | logtee $log + grep -E "BUILD" ${log} grep -E "${errors}" $log && exit 1 if test "${cleanup}" = "yes" ; then - echo "REMOVE: ${btlayer}" + echo "REMOVE DATA: ${btlayer}" rm -f -r ${btlayer} fi result=`tail -2 $log | head -1` - test "${result}" = "Build Successful." || ( tail -5 $log ; exit 1 ) + if test "${result}" = "Build Successful." ; then + echo "${result}" + else + echo "Build Failed:" + tail -5 $log + exit 1 + fi if test "${cleanup}" = "yes" ; then - echo "REMOVE: ${log}" + echo "REMOVE LOG: ${log}" rm -f -r $log fi } diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh index 0f50130dde..8c813562b8 100755 --- a/test-suite/buildtest.sh +++ b/test-suite/buildtest.sh @@ -6,31 +6,30 @@ # Should be run from the source package root directory with paths relative to there. # -dist="${1}" -base="`dirname $0`" +config="${1}" +base="`dirname ${0}`" #if we are on Linux, let's try parallelizing pjobs="" #default if [ -e /proc/cpuinfo ]; then ncpus=`grep '^processor' /proc/cpuinfo | tail -1|awk '{print $3}'` - ncpus=`expr $ncpus + 1` - pjobs="-j$ncpus" + ncpus=`expr ${ncpus} + 1` + pjobs="-j${ncpus}" fi -if test -e ${dist%%.opts}.opts ; then - echo "BUILD: ${dist%%.opts}.opts" - . ${dist%%.opts}.opts +if test -e ${config} ; then + echo "BUILD: ${config}" + . ${config} else - echo "BUILD: DEFAULT" - OPTS="" - FLAGS="" + echo -n "BUILD ERROR: Unable to locate test configuration '${config}' from " && pwd + exit 1; fi # # empty all the existing code, reconfigure and builds test code # but skip if we have no files to remove. FILECOUNT=`ls -1 | grep -c .` -if test "$FILECOUNT" != "0" ; then +if test "${FILECOUNT}" != "0" ; then make -k distclean || echo "distclean done. errors are unwanted but okay here." fi