]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merged from trunk.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 17 Mar 2009 04:31:38 +0000 (22:31 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 17 Mar 2009 04:31:38 +0000 (22:31 -0600)
1  2 
test-builds.sh

diff --cc test-builds.sh
index 583cff0f216e73606585bcfb7c3561bbbb791a68,eadbc7509e86bd42fdb6653981fa17484a532bc7..046c7ad6b97a61f07951e351888bb597731de595
@@@ -45,60 -41,30 +45,52 @@@ buildtest() 
      echo "TESTING: ${layer}"
      rm -f -r ${btlayer} && mkdir ${btlayer}
      {
 +      result=255
        cd ${btlayer}
        if test -e $top/test-suite/buildtest.sh ; then
-               $top/test-suite/buildtest.sh $opts
-               result=$?
 -              $top/test-suite/buildtest.sh ${opts} 2>&1
 -      elif test -e ../${top}/test-suite/buildtest.sh ; then
 -              ../${top}/test-suite/buildtest.sh ../${opts} 2>&1
++          $top/test-suite/buildtest.sh ${opts} 2>&1
++          result=$?
 +      elif test -e ../$top/test-suite/buildtest.sh ; then
-               ../$top/test-suite/buildtest.sh ../$opts
-               result=$?
++          ../$top/test-suite/buildtest.sh ../${opts} 2>&1
++          result=$?
 +      else
-               echo "Error: cannot find $top/test-suite/buildtest.sh script"
-               result=1
++          echo "Error: cannot find $top/test-suite/buildtest.sh script"
++          result=1
        fi
-     } 2>&1 | logtee $log
++
 +      # log the result for the outer script to notice
 +      echo "buildtest.sh result is $result";
-     if grep -q '^buildtest.sh result is 0$' $log; then
+     } 2>&1 | logtee ${log}
 +
 +    result=1 # failure by default
++    if grep -q '^buildtest.sh result is 0$' ${log}; then
 +      result=0
 +    fi
 +
      grep -E "BUILD" ${log}
-     # logged strings to treat as errors
 +
-     if grep -E "${errors}" $log; then
-       # Possible errors detected.
-       # Let's be conservative and assume those were real errors.
-       if test $result -eq 0; then
-           echo "Internal error: failed test with a successful result code"
-           result=1
-       # else we already know that there was an error
-       fi
-     fi
 +    errors="^ERROR|\ error:|\ Error\ |No\ such|assertion\ failed|FAIL:"
+     grep -E "${errors}" ${log}
 +
      if test "${cleanup}" = "yes" ; then
        echo "REMOVE DATA: ${btlayer}"
        rm -f -r ${btlayer}
      fi
 -    result=`tail -1 ${log}`
 -    if test "${result}" = "Build Successful." ; then
 -        echo "${result}"
 +
 +    if test $result -eq 0; then
 +      # successful execution
 +      if test "$verbose" = yes; then
 +          echo "Build OK. Global result is $globalResult."
 +      fi
      else
 -        echo "Build Failed:"
 -        tail -2 ${log}
 -        exit 1
 +        echo "Build Failed ($result):"
-         tail -5 $log
++        tail -5 ${log}
 +      globalResult=1
      fi
 +
      if test "${cleanup}" = "yes" ; then
        echo "REMOVE LOG: ${log}"
-       rm -f -r $log
+       rm -f -r ${log}
      fi
  }