Skip to content

Commit

Permalink
Make the test failure output more readable
Browse files Browse the repository at this point in the history
When the test failure output only had the failing test name it made
sense to have the lines numbered.  Now that the test error messages are
also in the failure list, the line numbering is confusing and hard to
read.  This gets rid of line numbering and replaces it with test
numbering, spaces out the failure results and moves the summary to the
end.
  • Loading branch information
Matt Robinson committed Sep 14, 2010
1 parent 81e0e95 commit a4affb9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions puppet_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ set -u
: ${TEST_DIR:=${1:-'./spec'}}

print_results() {
echo
cat $FAIL_LOG
echo
echo -n "$TOTAL tests, $FAILURES failures"
if [ "$PENDING" -ne 0 ] ; then
Expand All @@ -23,7 +25,6 @@ print_results() {
echo -n ", $SKIPPED skipped"
fi
echo
cat -n $FAIL_LOG
}

trap "print_results; exit" SIGINT
Expand Down Expand Up @@ -63,9 +64,10 @@ for SPEC in $(find $TEST_DIR -name '*_spec.sh' | sort) ; do
echo -n '~'
((SKIPPED++))
else
echo $SPEC >> $FAIL_LOG
echo $result >> $FAIL_LOG
((FAILURES++))
echo "$FAILURES) $SPEC" >> $FAIL_LOG
echo $result >> $FAIL_LOG
echo >> $FAIL_LOG
echo -n F
fi
fi
Expand Down

0 comments on commit a4affb9

Please sign in to comment.