Skip to content

Commit

Permalink
Merge pull request #7 from rackerjoe/master
Browse files Browse the repository at this point in the history
Added ONESHOT variable. When set to 1 exercises.sh will fail on any FAILED  test.
  • Loading branch information
breu committed Jul 6, 2012
2 parents 0075ebc + c7b6086 commit 034702d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions exercise.sh
Expand Up @@ -13,6 +13,7 @@ PACKAGESET=${1:-${PACKAGESET:-"diablo-final"}}
shift
TESTSCRIPTS=$@
BASEDIR=$(dirname $(readlink -f ${0}))
ONESHOT=${ONESHOT-0}

set -u

Expand Down Expand Up @@ -238,6 +239,14 @@ for d in ${TESTS}; do
echo >> ${TMPDIR}/notice.txt

FAILED=$(( ${FAILED} + 1 ))
if [ $ONESHOT -eq 1 ]; then
echo; echo "ONESHOT ACTIVATED!"; echo
if [ -e ${TMPDIR}/notice.txt ]; then
colourise red ERROR TEST OUTPUT
cat ${TMPDIR}/notice.txt
fi
exit 1
fi
colourise ${resultcolour} " ${result}"
elif [ $SKIP_TEST -eq 0 ]; then
result=$(printf "%0.3fs" "${elapsed}")
Expand Down

0 comments on commit 034702d

Please sign in to comment.