From: Peter Rabbitson Date: Thu, 4 Apr 2013 03:20:43 +0000 (+0200) Subject: Trap and display STDERR during travis test runs X-Git-Tag: v0.08210~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b99706371caa34a8782a9f6495c132ec419001bb;p=dbsrgits%2FDBIx-Class.git Trap and display STDERR during travis test runs --- diff --git a/maint/travis-ci_scripts/40_script.bash b/maint/travis-ci_scripts/40_script.bash index c044507..f3dd078 100755 --- a/maint/travis-ci_scripts/40_script.bash +++ b/maint/travis-ci_scripts/40_script.bash @@ -5,15 +5,28 @@ if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi export HARNESS_TIMER=1 HARNESS_OPTIONS=c:j$NUMTHREADS -START_TIME=$SECONDS +TEST_T0=$SECONDS if [[ "$CLEANTEST" = "true" ]] ; then echo_err "$(tstamp) Running tests with plain \`make test\`" run_or_err "Prepare blib" "make pure_all" - make test + make test 2> >(tee "$TEST_STDERR_LOG") else PROVECMD="prove -lrswj$NUMTHREADS t xt" echo_err "$(tstamp) running tests with \`$PROVECMD\`" - $PROVECMD + $PROVECMD 2> >(tee "$TEST_STDERR_LOG") fi +TEST_T1=$SECONDS -echo "$(tstamp) Testing took a total of $(( $SECONDS - $START_TIME ))s" +if [[ -z "$DBICTRACE" ]] && [[ -z "$POISON_ENV" ]] && [[ -s "$TEST_STDERR_LOG" ]] ; then + STDERR_LOG_SIZE=$(wc -l < "$TEST_STDERR_LOG") + + echo + echo "Test run produced $STDERR_LOG_SIZE lines of output on STDERR:" + echo "=============================================================" + cat "$TEST_STDERR_LOG" + echo "=============================================================" + echo "End of test run STDERR output ($STDERR_LOG_SIZE lines)" + echo +fi + +echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s" diff --git a/maint/travis-ci_scripts/common.bash b/maint/travis-ci_scripts/common.bash index 20d5d63..ee8fa00 100755 --- a/maint/travis-ci_scripts/common.bash +++ b/maint/travis-ci_scripts/common.bash @@ -2,6 +2,8 @@ set -e +TEST_STDERR_LOG=/tmp/dbictest.stderr + echo_err() { echo "$@" 1>&2 ; } if [[ "$TRAVIS" != "true" ]] ; then