From 93678fb4f2e1eedd2cbfdba393f10b54cf5ada22 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 17 Jul 2011 13:08:52 +0000 Subject: [PATCH] Issueing pacifier messages in run_all_releng about logged line --- libisoburn/trunk/releng/run_all_releng | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/libisoburn/trunk/releng/run_all_releng b/libisoburn/trunk/releng/run_all_releng index feb242ac..052be129 100755 --- a/libisoburn/trunk/releng/run_all_releng +++ b/libisoburn/trunk/releng/run_all_releng @@ -10,6 +10,28 @@ not_in_releng_exit() { exit 1 } +# 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 +count_lines() +{ + # $1 if not empty: start count + line= + if test -n "$1" + then + count="$1" + else + count=0 + fi + while read line + do + count=$(($count + 1)) + printf "\r %4d lines logged ... " "$count" >&2 + printf "%s\n" "$line" + done + return 0 +} + # It is not a good idea to include inc/releng_getopts.inc with the # master script as it calls the subordinate scripts and they include # this file too, and we want to avoid sharing variable with subshells @@ -29,7 +51,8 @@ next_is= for i in "$@" do if test "$next_is" = "ignore" - then : + then + dummy=dummy elif test "$next_is" = "x" then RELENG_XORRISO="$i" @@ -90,10 +113,11 @@ fi for s in `ls | grep ^releng_ | grep -v ${SELF} | sort -n`; do if [ -x ${s} -a ! -d ${s} ]; then echo -ne "\n\n_STARTING_TEST_________________________________________________________" >> ${CLOG} - echo -ne "\n${SELF}: Running ./${s} ${PASSED_OPTIONS}..." | tee -a ${CLOG} + echo -ne "\n${SELF}: Running ./${s} ${PASSED_OPTIONS} :\n" \ + | tee -a ${CLOG} T1=`date '+%s'` set +e - ./${s} ${PASSED_OPTIONS} &>> ${CLOG} + ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG} RET=$? T2=`date '+%s'` let TS="${T2} - ${T1}"