Fix missing "1 test failed" line

Also tweak colored output to reset before the newline instead of after,
so travis behaves better (for some reason reset causes travis to display
the line in black).
This commit is contained in:
Kevin Ballard 2014-09-23 22:50:28 -07:00
parent 5f82f721d2
commit 1563501868
2 changed files with 10 additions and 4 deletions

View file

@ -74,6 +74,7 @@ if test $failed -eq 0
say green "All tests completed successfully" say green "All tests completed successfully"
exit 0 exit 0
else else
say red "$failed test"(test $failed -eq 1; or echo s)" failed" set plural (test $failed -eq 1; or echo s)
say red "$failed test$plural failed"
exit 1 exit 1
end end

View file

@ -14,14 +14,18 @@ end
function say function say
set -l color_flags set -l color_flags
set -l suppress_newline
while set -q argv[1] while set -q argv[1]
switch $argv[1] switch $argv[1]
case -b -o -u case -b -o -u
set color_flags $color_flags $argv[1] set color_flags $color_flags $argv[1]
case -n
set suppress_newline 1
case -- case --
set -e argv[1] set -e argv[1]
break break
case -\* case -\*
continue
case \* case \*
break break
end end
@ -35,10 +39,11 @@ function say
if set_color $color_flags $argv[1] if set_color $color_flags $argv[1]
set -e argv[1] set -e argv[1]
echo $argv echo -n $argv
set -l stat $status
set_color reset set_color reset
or return $stat if test -z "$suppress_newline"
echo
end
end end
end end