winetest: Create the -d directory if it does not exist already.
'winetest.exe' automatically creates '%TEMP%\wct' (or an alternative new directory). 'winetext.exe -x DIR' automatically creates DIR. 'winetest.exe -d DIR' now automatically creates DIR too. In all cases newly created directories are removed after the tests. Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
20fff538c4
commit
dc8ef75904
|
@ -1024,6 +1024,7 @@ run_tests (char *logname, char *outdir)
|
||||||
DWORD strsize;
|
DWORD strsize;
|
||||||
SECURITY_ATTRIBUTES sa;
|
SECURITY_ATTRIBUTES sa;
|
||||||
char tmppath[MAX_PATH], tempdir[MAX_PATH+4];
|
char tmppath[MAX_PATH], tempdir[MAX_PATH+4];
|
||||||
|
BOOL newdir;
|
||||||
DWORD needed;
|
DWORD needed;
|
||||||
HMODULE kernel32;
|
HMODULE kernel32;
|
||||||
|
|
||||||
|
@ -1064,22 +1065,23 @@ run_tests (char *logname, char *outdir)
|
||||||
if (logfile == INVALID_HANDLE_VALUE)
|
if (logfile == INVALID_HANDLE_VALUE)
|
||||||
report (R_FATAL, "Could not open logfile: %u", GetLastError());
|
report (R_FATAL, "Could not open logfile: %u", GetLastError());
|
||||||
|
|
||||||
/* try stable path for ZoneAlarm */
|
if (outdir)
|
||||||
if (!outdir) {
|
|
||||||
strcpy( tempdir, tmppath );
|
|
||||||
strcat( tempdir, "wct" );
|
|
||||||
|
|
||||||
if (!CreateDirectoryA( tempdir, NULL ))
|
|
||||||
{
|
|
||||||
if (!GetTempFileNameA( tmppath, "wct", 0, tempdir ))
|
|
||||||
report (R_FATAL, "Can't name temporary dir (check %%TEMP%%).");
|
|
||||||
DeleteFileA( tempdir );
|
|
||||||
if (!CreateDirectoryA( tempdir, NULL ))
|
|
||||||
report (R_FATAL, "Could not create directory: %s", tempdir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
strcpy( tempdir, outdir);
|
strcpy( tempdir, outdir);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy( tempdir, tmppath );
|
||||||
|
strcat( tempdir, "wct" ); /* try stable path for ZoneAlarm */
|
||||||
|
}
|
||||||
|
newdir = CreateDirectoryA( tempdir, NULL );
|
||||||
|
if (!newdir && !outdir)
|
||||||
|
{
|
||||||
|
if (!GetTempFileNameA( tmppath, "wct", 0, tempdir ))
|
||||||
|
report (R_FATAL, "Can't name temporary dir (check %%TEMP%%).");
|
||||||
|
DeleteFileA( tempdir );
|
||||||
|
newdir = CreateDirectoryA( tempdir, NULL );
|
||||||
|
}
|
||||||
|
if (!newdir && (!outdir || GetLastError() != ERROR_ALREADY_EXISTS))
|
||||||
|
report (R_FATAL, "Could not create directory %s (%d)", tempdir, GetLastError());
|
||||||
|
|
||||||
report (R_DIR, tempdir);
|
report (R_DIR, tempdir);
|
||||||
|
|
||||||
|
@ -1172,7 +1174,7 @@ run_tests (char *logname, char *outdir)
|
||||||
report (R_STATUS, "Cleaning up - %u failures", failures);
|
report (R_STATUS, "Cleaning up - %u failures", failures);
|
||||||
CloseHandle( logfile );
|
CloseHandle( logfile );
|
||||||
logfile = 0;
|
logfile = 0;
|
||||||
if (!outdir)
|
if (newdir)
|
||||||
remove_dir (tempdir);
|
remove_dir (tempdir);
|
||||||
heap_free(wine_tests);
|
heap_free(wine_tests);
|
||||||
heap_free(curpath);
|
heap_free(curpath);
|
||||||
|
|
Loading…
Reference in New Issue