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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Francois Gouget 2021-12-20 11:46:18 +01:00 committed by Alexandre Julliard
parent 535da77552
commit 2da7e5de23
1 changed files with 3 additions and 2 deletions

View File

@ -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);