]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2613: test-builds.sh does not test what it claims to test
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 8 Mar 2009 10:57:37 +0000 (23:57 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 8 Mar 2009 10:57:37 +0000 (23:57 +1300)
* 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

test-builds.sh
test-suite/buildtest.sh

index ac92755c20d3c09bc06e544061aa2e1139d80466..b53080d892792e48b25e954492f8ef176db51ad1 100755 (executable)
@@ -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
 }
index 0f50130ddee07adca2db1565644c3558cb9defc3..8c813562b88c4b5aba3d9c8f22b3c7f92189c82e 100755 (executable)
@@ -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