From: Alex Rousskov Date: Tue, 17 Mar 2009 04:31:38 +0000 (-0600) Subject: Merged from trunk. X-Git-Tag: SQUID_3_2_0_1~1119^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e790ef310ea32e798990c07e4ebc11d243f998e;p=thirdparty%2Fsquid.git Merged from trunk. --- 7e790ef310ea32e798990c07e4ebc11d243f998e diff --cc test-builds.sh index 583cff0f21,eadbc7509e..046c7ad6b9 --- a/test-builds.sh +++ b/test-builds.sh @@@ -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 ++ + # log the result for the outer script to notice + echo "buildtest.sh result is $result"; - } 2>&1 | logtee $log + } 2>&1 | logtee ${log} + + result=1 # failure by default - if grep -q '^buildtest.sh result is 0$' $log; then ++ if grep -q '^buildtest.sh result is 0$' ${log}; then + result=0 + fi + grep -E "BUILD" ${log} + - # logged strings to treat as errors + errors="^ERROR|\ error:|\ Error\ |No\ such|assertion\ failed|FAIL:" - 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 + 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 }