From 982bb6cf0704b36d7d655b34e9d4b7617d8137a6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 14 Aug 2019 02:48:59 +0200 Subject: 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. --- tests/test-libtextstyle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/test-libtextstyle.c') 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 -- cgit v1.2.1