From e7d68fc4b60bec11fd9524ec5decaeeb0e3c4c87 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 4 Oct 2017 09:28:37 -0700 Subject: [PATCH] [v9_11] copy the color-coded test functions to conf.sh.win32 --- bin/tests/system/conf.sh.win32 | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/bin/tests/system/conf.sh.win32 b/bin/tests/system/conf.sh.win32 index e4411d3cff..33d58c4f08 100644 --- a/bin/tests/system/conf.sh.win32 +++ b/bin/tests/system/conf.sh.win32 @@ -142,6 +142,43 @@ NZD=@NZD_TOOLS@ . ${TOP}/version +# +# Set up color-coded test output +# +if test -t 1 && type tput > /dev/null; then + COLOR_FAIL=`tput setaf 1` # red + COLOR_WARN=`tput setaf 3` # yellow + COLOR_PASS=`tput setaf 2` # green + COLOR_INFO=`tput bold` # bold + COLOR_NONE=`tput sgr0` +else + # set to empty strings so printf succeeds + COLOR_FAIL='' + COLOR_WARN='' + COLOR_PASS='' + COLOR_INFO='' + COLOR_NONE='' +fi + +echofail () { + printf "${COLOR_FAIL}%s${COLOR_NONE}\n" "$*" +} + +echowarn () { + printf "${COLOR_WARN}%s${COLOR_NONE}\n" "$*" +} + +echopass () { + printf "${COLOR_PASS}%s${COLOR_NONE}\n" "$*" +} + +echoinfo () { + printf "${COLOR_INFO}%s${COLOR_NONE}\n" "$*" +} + +# +# Export command paths +# export ARPANAME export BIGKEY export CHECKZONE