From 364f9440ccc3bf54ae1db3455fbb9b6a6e9e1b2c Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Thu, 4 Sep 2014 00:12:05 -0500 Subject: only use colors when attached to a terminal If STDOUT is not hooked up to a terminal, automatically disable the colors by setting the appropriate environment variable. --- runtests.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtests.pl b/runtests.pl index 5facbe6..adcc373 100644 --- a/runtests.pl +++ b/runtests.pl @@ -16,6 +16,9 @@ if (!(defined $PROG && defined $SPEC)) { exit 1; } +# Disable ANSI colors if we're not hooked up to a terminal +$ENV{ANSI_COLORS_DISABLED} ||= !-t *STDOUT; + my $passed = 0; my $failed = 0; my $skipped = 0; -- cgit v1.2.3