summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorTyson Andre <tysonandre775@hotmail.com>2020-08-09 11:26:51 -0400
committerTyson Andre <tysonandre775@hotmail.com>2020-08-12 09:37:45 -0400
commit45d69fb80942af07cad5fb26d49200942a9deca8 (patch)
treece6112bb72edbcd361bd9b6e5c1ead063c5db140 /run-tests.php
parentb480e6841ecd5317faa136647a2b8253a4c2d0df (diff)
downloadphp-git-45d69fb80942af07cad5fb26d49200942a9deca8.tar.gz
Support NO_COLOR environment variable in run-tests.php
And add a --color option for run-tests.php See https://no-color.org/ > an informal standard is hereby proposed: > > All command-line software which outputs text with ANSI color added should check > for the presence of a `NO_COLOR` environment variable that, when present > (regardless of its value), prevents the addition of ANSI color.
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/run-tests.php b/run-tests.php
index 7d71b81610..c89b6971eb 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -114,7 +114,8 @@ Options:
--no-clean Do not execute clean section if any.
- --no-color Do not colorize the result type in the test result
+ --color
+ --no-color Do/Don't colorize the result type in the test result.
HELP;
@@ -390,6 +391,9 @@ function main(): void
if (function_exists('sapi_windows_vt100_support') && !sapi_windows_vt100_support(STDOUT, true)) {
$colorize = false;
}
+ if (array_key_exists('NO_COLOR', $_ENV)) {
+ $colorize = false;
+ }
$selected_tests = false;
$slow_min_ms = INF;
$preload = false;
@@ -536,6 +540,9 @@ function main(): void
case '--no-clean':
$no_clean = true;
break;
+ case '--color':
+ $colorize = true;
+ break;
case '--no-color':
$colorize = false;
break;