From 2da7e5de237deb3281e7469bd55cfaf710e4ee22 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Mon, 20 Dec 2021 11:46:18 +0100 Subject: [PATCH] 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 Signed-off-by: Alexandre Julliard --- 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);