From 5b2ab72ee111443db6a934edfc13fa4bace4b09c Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Thu, 31 Mar 2016 19:54:27 +0000 Subject: [PATCH] change success and failure symbols --- tests/Flags/.urchin-output-expectation | 4 ++-- urchin | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/Flags/.urchin-output-expectation b/tests/Flags/.urchin-output-expectation index c1d8178..6fa5c98 100644 --- a/tests/Flags/.urchin-output-expectation +++ b/tests/Flags/.urchin-output-expectation @@ -1,11 +1,11 @@ ./ > a -✗ sh (1 second) +F sh (1 second) | This is stdout from a. ./ > b -✓ sh (1 second) +. sh (1 second) ./ > c (File is not executable.) diff --git a/urchin b/urchin index fae4b83..bf401dc 100755 --- a/urchin +++ b/urchin @@ -346,15 +346,15 @@ report_outcome() { printf "$(dirname -- "${path}")/\n> $(basename -- "${path}")\n" fi } + case "${result}" in ok) if "${print_ok}"; then header - # On success, print a green '✓' if "${print_in_color}"; then - printf '\033[32m✓ \033[0m' + printf "\033[32m${success_mark} \033[0m" else - printf '✓ ' + printf "${success_mark} " fi echo "${the_shell} ("${file_elapsed}" $(plural second $file_elapsed))" fi @@ -362,11 +362,10 @@ report_outcome() { not_ok) if "${print_not_ok}"; then header - # On not_ok, print a red '✗' if "${print_in_color}"; then - printf '\033[31m✗ \033[0m' + printf "\033[31m${fail_mark} \033[0m" else - printf '✗ ' + printf "${fail_mark} " fi echo "${the_shell} ("${file_elapsed}" $(plural second $file_elapsed))" fi @@ -571,6 +570,14 @@ main() { shift done + if $print_in_color; then + success_mark=✓ + fail_mark=✗ + else + success_mark=. + fail_mark=F + fi + # -------------------- VALIDATE INPUT -------------------- # if ! "${cycle_shell}" && test -f "${shell_list}"; then echo "The -n/--disable-cycling and -s/--shell options clash with each other." >&2