test.h: WINETEST_COLOR=auto only outputs colors to a TTY.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
This commit is contained in:
Eric Pouech 2022-08-03 09:52:06 +02:00 committed by Alexandre Julliard
parent e83b91ddef
commit 1cbbbd9d73

View file

@ -23,6 +23,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <io.h>
#include <windef.h>
#include <winbase.h>
#include <wine/debug.h>
@ -676,7 +677,8 @@ int main( int argc, char **argv )
else if (running_under_wine())
winetest_platform = "wine";
if (GetEnvironmentVariableA( "WINETEST_COLOR", p, sizeof(p) )) winetest_color = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_COLOR", p, sizeof(p) ))
winetest_color = !strcasecmp(p, "auto") ? isatty(fileno(stdout)) : atoi(p);
if (GetEnvironmentVariableA( "WINETEST_DEBUG", p, sizeof(p) )) winetest_debug = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_INTERACTIVE", p, sizeof(p) )) winetest_interactive = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", p, sizeof(p) )) winetest_report_success = atoi(p);