diff options
author | P. 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) |
commit | 9f46fc5e8495af7316d086c2576b535544b144a6 (patch) | |
tree | 8bbda447a8444eb151cc4459de23154a785787ff /tests | |
parent | a0e81f7af8c20a8678ef4ebea00ccecdc7ffcae8 (diff) |
Support colors in test logs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common.sh | 11 |
1 files changed, 11 insertions, 0 deletions
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='[0;31m' # Red. + grn='[0;32m' # Green. + lgn='[1;32m' # Light green. + blu='[1;34m' # Blue. + mgn='[0;35m' # Magenta. + std='[m' # No color. +fi |