summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-16 11:55:26 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-16 16:18:22 (EDT)
commit9f46fc5e8495af7316d086c2576b535544b144a6 (patch)
tree8bbda447a8444eb151cc4459de23154a785787ff
parenta0e81f7af8c20a8678ef4ebea00ccecdc7ffcae8 (diff)
Support colors in test logs
-rw-r--r--Makefile.am2
-rw-r--r--tests/common.sh11
2 files changed, 12 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index db8b53b..85a1be4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,7 +62,7 @@ do_subst = sed \
-e "s|[@]profiles[@]|$(profiles)|g" \
-e "s|[@]textdomain[@]|$(textdomain)|g"
-AM_TESTS_ENVIRONMENT = srcdir=$(top_srcdir)
+AM_TESTS_ENVIRONMENT = srcdir=$(top_srcdir) COLOR_TEST_LOGS=$(COLOR_TEST_LOGS)
all-local: $(locale_MESSAGES)
touch .builddirstamp
diff --git a/tests/common.sh b/tests/common.sh
index 93f8d53..f7467ee 100644
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -55,3 +55,14 @@ assert()
tests_es=1
fi
}
+
+if [ "x${COLOR_TEST_LOGS:-no}" = 'xno' ]; then
+ red= grn= lgn= blu= mgn= std=
+else
+ red='' # Red.
+ grn='' # Green.
+ lgn='' # Light green.
+ blu='' # Blue.
+ mgn='' # Magenta.
+ std='' # No color.
+fi