summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Bell <madcityzen@gmail.com>2014-09-04 00:12:05 -0500
committerDoug Bell <madcityzen@gmail.com>2014-09-04 00:12:05 -0500
commit364f9440ccc3bf54ae1db3455fbb9b6a6e9e1b2c (patch)
tree9db1e360e1e95354053d95e8e8e2a6e366a1cb6e
parente92aabbbf6b02339cd160203f054f5f150d951f2 (diff)
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.
-rw-r--r--runtests.pl3
1 files changed, 3 insertions, 0 deletions
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;