mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
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.
This commit is contained in:
parent
b480e6841e
commit
45d69fb809
1 changed files with 8 additions and 1 deletions
|
@ -114,7 +114,8 @@ Options:
|
||||||
|
|
||||||
--no-clean Do not execute clean section if any.
|
--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;
|
HELP;
|
||||||
|
@ -390,6 +391,9 @@ function main(): void
|
||||||
if (function_exists('sapi_windows_vt100_support') && !sapi_windows_vt100_support(STDOUT, true)) {
|
if (function_exists('sapi_windows_vt100_support') && !sapi_windows_vt100_support(STDOUT, true)) {
|
||||||
$colorize = false;
|
$colorize = false;
|
||||||
}
|
}
|
||||||
|
if (array_key_exists('NO_COLOR', $_ENV)) {
|
||||||
|
$colorize = false;
|
||||||
|
}
|
||||||
$selected_tests = false;
|
$selected_tests = false;
|
||||||
$slow_min_ms = INF;
|
$slow_min_ms = INF;
|
||||||
$preload = false;
|
$preload = false;
|
||||||
|
@ -536,6 +540,9 @@ function main(): void
|
||||||
case '--no-clean':
|
case '--no-clean':
|
||||||
$no_clean = true;
|
$no_clean = true;
|
||||||
break;
|
break;
|
||||||
|
case '--color':
|
||||||
|
$colorize = true;
|
||||||
|
break;
|
||||||
case '--no-color':
|
case '--no-color':
|
||||||
$colorize = false;
|
$colorize = false;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue