Permalink
Browse files

Merge branch 'results'

* results:
  Make the test failure output more readable
  Fix typos from chromatic's patch
  Made harness record diagnostic output for failures.
  • Loading branch information...
2 parents fde3248 + a4affb9 commit 71d191a2b950402e56281e134ed07dca3af1ee7e Matt Robinson committed Sep 14, 2010
Showing with 10 additions and 5 deletions.
  1. +10 −5 puppet_spec.sh
View
@@ -15,6 +15,8 @@ set -u
print_results() {
echo
+ cat $FAIL_LOG
+ echo
echo -n "$TOTAL tests, $FAILURES failures"
if [ "$PENDING" -ne 0 ] ; then
echo -n ", $PENDING pending"
@@ -23,7 +25,6 @@ print_results() {
echo -n ", $SKIPPED skipped"
fi
echo
- cat -n $FAIL_LOG
}
trap "print_results; exit" SIGINT
@@ -51,17 +52,22 @@ for SPEC in $(find $TEST_DIR -name '*_spec.sh' | sort) ; do
((PENDING++))
continue
fi
- if $SPEC >& /dev/null ; then
+
+ result=$($SPEC 2>&1)
+ TEST_ERROR=$?
+
+ if [ $TEST_ERROR -eq $EXIT_OK ] ; then
echo -n .
else
- TEST_ERROR=$?
# JJM Detect if script exited with code $EXIT_NOT_APPLICABLE
if [ $TEST_ERROR -eq $EXIT_NOT_APPLICABLE ] ; then
echo -n '~'
((SKIPPED++))
else
- echo $SPEC >> $FAIL_LOG
((FAILURES++))
+ echo "$FAILURES) $SPEC" >> $FAIL_LOG
+ echo $result >> $FAIL_LOG
+ echo >> $FAIL_LOG
echo -n F
fi
fi
@@ -72,4 +78,3 @@ print_results
# JJM Exit with FAILURE status if the number of failures are not zero.
[ $FAILURES -eq 0 ] && exit $EXIT_OK || exit $EXIT_FAILURE
-

0 comments on commit 71d191a

Please sign in to comment.