From 0f3d8fedf88187959d639bb4e2a30edf0af90877 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 17 Jul 2011 13:38:52 +0000 Subject: [PATCH] Making run_all_releng recognize exit values again (fixing rev 4185) --- libisoburn/trunk/releng/run_all_releng | 37 ++++++++++++++++++-------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/libisoburn/trunk/releng/run_all_releng b/libisoburn/trunk/releng/run_all_releng index 052be129..aa63294f 100755 --- a/libisoburn/trunk/releng/run_all_releng +++ b/libisoburn/trunk/releng/run_all_releng @@ -5,11 +5,30 @@ set -e +SELF=$(basename "$0") +GEN_DATA_DIR=releng_generated_data +CLOG=${GEN_DATA_DIR}/log.${SELF} +PASSED_OPTIONS="$@" +RELENG_XORRISO= +CLEANUP_LOG=0 + not_in_releng_exit() { printf "\nPlease execute the tests from releng directory.\n\n" exit 1 } +# To catch the exit value of a command in a pipe +return_value_file="$GEN_DATA_DIR"/run_all_"$$"_return_value +return_wrapper() +{ + cmd="$1" + shift 1 + "$cmd" "$@" + RET="$?" + echo "$RET" >"$return_value_file" + return "$RET" +} + # Using only bash builtin commands. # On 4 year old amd64 x2 3000 MHz, xterm local,it counts 22471 lines per second # On 2 year old amd64 x4 2600 MHz, ssh remote, it counts 35348 lines per second @@ -39,20 +58,12 @@ if [ ! -f inc/releng_getopts.inc ]; then not_in_releng_exit fi -SELF=$(basename "$0") -GEN_DATA_DIR=releng_generated_data -CLOG=${GEN_DATA_DIR}/log.${SELF} -PASSED_OPTIONS="$@" -RELENG_XORRISO= -CLEANUP_LOG=0 - ############################################# next_is= for i in "$@" do if test "$next_is" = "ignore" - then - dummy=dummy + then : elif test "$next_is" = "x" then RELENG_XORRISO="$i" @@ -117,8 +128,12 @@ fi | tee -a ${CLOG} T1=`date '+%s'` set +e - ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG} - RET=$? + + return_wrapper ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG} + RET=$(cat "$return_value_file") + rm "$return_value_file" +# echo "RET='$RET'" >/dev/tty + T2=`date '+%s'` let TS="${T2} - ${T1}" case ${RET} in