From: Evan Hunt Date: Wed, 4 Oct 2017 16:27:40 +0000 (-0700) Subject: [master] copy the color-coded test functions to conf.sh.win32 X-Git-Tag: v9.12.0b1~92 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9a28f666103871726eda466d225e4987fdd69a44;p=thirdparty%2Fbind9.git [master] copy the color-coded test functions to conf.sh.win32 --- diff --git a/bin/tests/system/conf.sh.win32 b/bin/tests/system/conf.sh.win32 index 960bb10c848..33b26a13e11 100644 --- a/bin/tests/system/conf.sh.win32 +++ b/bin/tests/system/conf.sh.win32 @@ -139,6 +139,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