print skip count at end

This commit is contained in:
Thomas Levine 2016-01-27 10:24:28 +00:00
parent 1cd9991587
commit a51d96631f

12
urchin
View File

@ -206,10 +206,14 @@ urchin_go() {
echo "# Took $elapsed $(plural second $elapsed)." echo "# Took $elapsed $(plural second $elapsed)."
else else
echo "Done, took $elapsed $(plural second $elapsed)." echo "Done, took $elapsed $(plural second $elapsed)."
set -- $(grep -e 'passed$' "$logfile"|wc -l) $(grep -e 'failed$' "$logfile"|wc -l) passed=$(grep -c 'passed$' "$logfile")
printf '%s\n' "$1 $(plural test "$1") passed." failed=$(grep -c 'failed$' "$logfile")
[ $2 -gt 0 ] && printf '\033[31m' || printf '\033[32m' # If tests failed, print the message in red, otherwise in green. skipped=$(grep -c 'skipped$' "$logfile")
printf '%s\n' "$2 $(plural test "$2") failed."
printf '%s\n' "$passed $(plural test "$passed") passed."
printf '%s\n' "$skipped $(plural test "$skipped") skipped."
[ $failed -gt 0 ] && printf '\033[31m' || printf '\033[32m' # If tests failed, print the message in red, otherwise in green.
printf '%s\n' "$failed $(plural test "$failed") failed."
printf '\033[m' printf '\033[m'
fi fi
test -z "$2" || test "$2" -eq '0' test -z "$2" || test "$2" -eq '0'