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

Alexandre Julliard julliard at winehq.org
Mon Aug 8 15:17:51 CDT 2022


Module: wine
Branch: master
Commit: 1cbbbd9d737f315042313e587a20b453e2660618
URL:    https://gitlab.winehq.org/wine/wine/-/commit/1cbbbd9d737f315042313e587a20b453e2660618

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Wed Aug  3 09:52:06 2022 +0200

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

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---

 include/wine/test.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/wine/test.h b/include/wine/test.h
index 7779e252dd7..1690c5613d8 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -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);




More information about the wine-cvs mailing list