]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] copy the color-coded test functions to conf.sh.win32
authorEvan Hunt <each@isc.org>
Wed, 4 Oct 2017 16:27:40 +0000 (09:27 -0700)
committerEvan Hunt <each@isc.org>
Wed, 4 Oct 2017 16:27:40 +0000 (09:27 -0700)
bin/tests/system/conf.sh.win32

index 960bb10c848b81adb7c7ad7edd5132b447aa54bd..33b26a13e115793a4528932100d3cbb662e99d0d 100644 (file)
@@ -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