summaryrefslogtreecommitdiff
path: root/tests/test-libtextstyle.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-08-14 02:48:59 +0200
committerBruno Haible <bruno@clisp.org>2019-08-14 02:49:42 +0200
commit982bb6cf0704b36d7d655b34e9d4b7617d8137a6 (patch)
tree06c8be81b0da6f25df36877315aa6ff974d8559d /tests/test-libtextstyle.c
parent96443cc734f3486014b10f4351fc84cae17f9165 (diff)
downloadgnulib-982bb6cf0704b36d7d655b34e9d4b7617d8137a6.tar.gz
libtextstyle-optional tests: Support the NO_COLOR environment variable.
* tests/test-libtextstyle.c (main): Do not emit styling when the environment variable NO_COLOR is set.
Diffstat (limited to 'tests/test-libtextstyle.c')
-rw-r--r--tests/test-libtextstyle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test-libtextstyle.c b/tests/test-libtextstyle.c
index 970713f821..a6567f9f5a 100644
--- a/tests/test-libtextstyle.c
+++ b/tests/test-libtextstyle.c
@@ -57,7 +57,9 @@ main (int argc, char *argv[])
#if HAVE_LIBTEXTSTYLE
if (color_mode == color_yes
- || (color_mode == color_tty && isatty (STDOUT_FILENO))
+ || (color_mode == color_tty
+ && isatty (STDOUT_FILENO)
+ && getenv ("NO_COLOR") == NULL)
|| color_mode == color_html)
{
/* If no style file is explicitly specified, use the default in the