diff options
author | Bruno Haible <bruno@clisp.org> | 2019-08-14 02:48:59 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-08-14 02:49:42 +0200 |
commit | 982bb6cf0704b36d7d655b34e9d4b7617d8137a6 (patch) | |
tree | 06c8be81b0da6f25df36877315aa6ff974d8559d | |
parent | 96443cc734f3486014b10f4351fc84cae17f9165 (diff) | |
download | gnulib-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.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | tests/test-libtextstyle.c | 4 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2019-08-13 Bruno Haible <bruno@clisp.org> + + 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. + 2019-08-12 Paul Eggert <eggert@cs.ucla.edu> verify: improve diagnostic quality in recent GCC 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 |