in reply to redirecting output from a format

Why do you want the output from Test::Harness in a scalar? What do you plan to do with it?

xoxo,
Andy

Replies are listed 'Best First'.
Re^2: redirecting output from a format
by mpeters (Chaplain) on Dec 02, 2004 at 18:23 UTC
    I'm trying to capture it and send it in an email... automated build with an accompanying test whose results are sent to the development team
      So why bother capturing runtests()? Catch the output of make test or prove.

      Here's the smokebot that we use. At some point I should put it into Test::Harness proper.

      #!/bin/sh if [ $# -lt 2 ] then echo Must pass at least a branch, and one email address,. echo plus any parms to echo pass to smoke. exit 1 fi BRANCH=$1 shift MAIL=$1 shift cd $TMP DIR=tw FULLPATH=$TMP/$DIR # This assumes you have already logged in once as anoncvs # so that the password is in your ~/.cvspass file. #cvs -d/home/cvs -Q co -d $DIR -r $REV tw > /dev/null svn co file:///home/svn/tw/$BRANCH $DIR > /dev/null TWROOT=$FULLPATH export TWROOT /home/smoke/tw/Dev/devapache stop > /dev/null 2>&1 /home/smoke/tw/Dev/devapache start > /home/smoke/smoke.out 2>&1. cd $TWROOT smoke $@ >> /home/smoke/smoke.out 2>&1. grep -i "^Failed" /home/smoke/smoke.out > /home/smoke/smoke.out.fail if [ -s /home/smoke/smoke.out.fail ] then STATUS="FAILED" mail -s"Smoke $REV $@ $STATUS `date`" $MAIL < /home/smoke/smoke.ou +t else STATUS="passed" fi /home/smoke/tw/Dev/devapache stop >> /home/smoke/smoke.out 2>&1.
      Note that smoke is an early predecessor to prove, so modify for your tastes.

      xoxo,
      Andy