Making run_all_releng recognize exit values again (fixing rev 4185)

This commit is contained in:
Thomas Schmitt 2011-07-17 13:38:52 +00:00
parent 886388d919
commit 92ef566e12

View File

@ -5,11 +5,30 @@
set -e 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() { not_in_releng_exit() {
printf "\nPlease execute the tests from releng directory.\n\n" printf "\nPlease execute the tests from releng directory.\n\n"
exit 1 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. # Using only bash builtin commands.
# On 4 year old amd64 x2 3000 MHz, xterm local,it counts 22471 lines per second # 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 # 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 not_in_releng_exit
fi 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= next_is=
for i in "$@" for i in "$@"
do do
if test "$next_is" = "ignore" if test "$next_is" = "ignore"
then then :
dummy=dummy
elif test "$next_is" = "x" elif test "$next_is" = "x"
then then
RELENG_XORRISO="$i" RELENG_XORRISO="$i"
@ -117,8 +128,12 @@ fi
| tee -a ${CLOG} | tee -a ${CLOG}
T1=`date '+%s'` T1=`date '+%s'`
set +e 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'` T2=`date '+%s'`
let TS="${T2} - ${T1}" let TS="${T2} - ${T1}"
case ${RET} in case ${RET} in