From: Peter Rabbitson Date: Wed, 26 Mar 2014 07:11:43 +0000 (+0100) Subject: Add progress meter to travis builds X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db57071fd969d9357a96a9b07f7ae65f5cce51e5;p=dbsrgits%2FDBIx-Class-Historic.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