From: Peter Rabbitson Date: Wed, 26 Mar 2014 07:11:43 +0000 (+0100) Subject: Add progress meter to travis builds X-Git-Tag: v0.082800~227 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f1a96a2e99bec81a1dcd86fbded3baa37730174;p=dbsrgits%2FDBIx-Class.git Add progress meter to travis builds --- diff --git a/maint/travis-ci_scripts/common.bash b/maint/travis-ci_scripts/common.bash index 896a44c..da6ce33 100755 --- a/maint/travis-ci_scripts/common.bash +++ b/maint/travis-ci_scripts/common.bash @@ -20,7 +20,16 @@ run_or_err() { LASTCMD="$2" LASTEXIT=0 START_TIME=$SECONDS + + PRMETER_PIDFILE="$(tempfile)_$SECONDS" + # the double bash is to hide the job control messages + bash -c "bash -c 'echo \$\$ >> $PRMETER_PIDFILE; while true; do sleep 10; echo -n \"\${SECONDS}s ... \"; done' &" + LASTOUT=$( eval "$2" 2>&1 ) || LASTEXIT=$? + + # stop progress meter + for p in $(cat "$PRMETER_PIDFILE"); do kill $p ; done + DELTA_TIME=$(( $SECONDS - $START_TIME )) if [[ "$LASTEXIT" != "0" ]] ; then