Francois Gouget : winetest: Send the tests output to stdout when given "-o -".

Alexandre Julliard julliard at winehq.org
Mon Dec 20 15:42:39 CST 2021


Module: wine
Branch: master
Commit: 2da7e5de237deb3281e7469bd55cfaf710e4ee22
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2da7e5de237deb3281e7469bd55cfaf710e4ee22

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Dec 20 11:46:18 2021 +0100

winetest: Send the tests output to stdout when given "-o -".

This makes it easier to use WineTest with tools that capture stdout,
such as the TestBot.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/winetest/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 7ced565447b..0c431a903d7 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -1051,7 +1051,8 @@ run_tests (char *logname, char *outdir)
     sa.lpSecurityDescriptor = NULL;
     sa.bInheritHandle = TRUE;
 
-    logfile = CreateFileA( logname, GENERIC_READ|GENERIC_WRITE,
+    logfile = strcmp(logname, "-") == 0 ? GetStdHandle( STD_OUTPUT_HANDLE ) :
+              CreateFileA( logname, GENERIC_READ|GENERIC_WRITE,
                            FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
                            &sa, CREATE_ALWAYS, 0, NULL );
 
@@ -1175,7 +1176,7 @@ run_tests (char *logname, char *outdir)
     report (R_DELTA, 0, "Running: Done");
 
     report (R_STATUS, "Cleaning up - %u failures", failures);
-    CloseHandle( logfile );
+    if (strcmp(logname, "-") != 0) CloseHandle( logfile );
     logfile = 0;
     if (newdir)
         remove_dir (tempdir);




More information about the wine-cvs mailing list