- Remove the -u option, the URL is in a resource now.
- Reset the WINETEST_* environmental variables to their defaults before forking the tests. - Add the -e option to optionally preserve the environment.
This commit is contained in:
parent
d7357a4956
commit
2d0d484786
|
@ -403,7 +403,7 @@ EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType,
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
run_tests (char *logname, const char *tag, const char *url)
|
run_tests (char *logname, const char *tag)
|
||||||
{
|
{
|
||||||
int nr_of_files = 0, nr_of_tests = 0, i;
|
int nr_of_files = 0, nr_of_tests = 0, i;
|
||||||
char *tempdir;
|
char *tempdir;
|
||||||
|
@ -510,12 +510,12 @@ usage ()
|
||||||
fprintf (stderr, "\
|
fprintf (stderr, "\
|
||||||
Usage: winetest [OPTION]...\n\n\
|
Usage: winetest [OPTION]...\n\n\
|
||||||
-c console mode, no GUI\n\
|
-c console mode, no GUI\n\
|
||||||
|
-e preserve the environment\n\
|
||||||
-h print this message and exit\n\
|
-h print this message and exit\n\
|
||||||
-q quiet mode, no output at all\n\
|
-q quiet mode, no output at all\n\
|
||||||
-o FILE put report into FILE, do not submit\n\
|
-o FILE put report into FILE, do not submit\n\
|
||||||
-s FILE submit FILE, do not run tests\n\
|
-s FILE submit FILE, do not run tests\n\
|
||||||
-t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n\
|
-t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n");
|
||||||
-u URL archive URL of this executable\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* One can't nest strtok()-s, so here is a replacement. */
|
/* One can't nest strtok()-s, so here is a replacement. */
|
||||||
|
@ -546,7 +546,8 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
||||||
LPSTR cmdLine, int cmdShow)
|
LPSTR cmdLine, int cmdShow)
|
||||||
{
|
{
|
||||||
char *logname = NULL;
|
char *logname = NULL;
|
||||||
const char *cp, *submit = NULL, *tag = NULL, *url = NULL;
|
const char *cp, *submit = NULL, *tag = NULL;
|
||||||
|
int reset_env = 1;
|
||||||
|
|
||||||
/* initialize the revision information first */
|
/* initialize the revision information first */
|
||||||
extract_rev_infos();
|
extract_rev_infos();
|
||||||
|
@ -562,6 +563,9 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
||||||
case 'c':
|
case 'c':
|
||||||
report (R_TEXTMODE);
|
report (R_TEXTMODE);
|
||||||
break;
|
break;
|
||||||
|
case 'e':
|
||||||
|
reset_env = 0;
|
||||||
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
usage ();
|
usage ();
|
||||||
exit (0);
|
exit (0);
|
||||||
|
@ -570,13 +574,12 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
submit = mystrtok (NULL);
|
submit = mystrtok (NULL);
|
||||||
if (tag||url)
|
if (tag)
|
||||||
report (R_WARNING, "ignoring tag and url for submit");
|
report (R_WARNING, "ignoring tag for submission");
|
||||||
send_file (submit);
|
send_file (submit);
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
logname = mystrtok (NULL);
|
logname = mystrtok (NULL);
|
||||||
run_tests (logname, tag, url);
|
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
tag = mystrtok (NULL);
|
tag = mystrtok (NULL);
|
||||||
|
@ -587,9 +590,6 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
||||||
exit (2);
|
exit (2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'u':
|
|
||||||
url = mystrtok (NULL);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
report (R_ERROR, "invalid option: -%c", cmdLine[1]);
|
report (R_ERROR, "invalid option: -%c", cmdLine[1]);
|
||||||
usage ();
|
usage ();
|
||||||
|
@ -597,9 +597,15 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
||||||
}
|
}
|
||||||
cmdLine = mystrtok (NULL);
|
cmdLine = mystrtok (NULL);
|
||||||
}
|
}
|
||||||
if (!logname && !submit) {
|
if (!submit) {
|
||||||
|
if (reset_env && (putenv ("WINETEST_PLATFORM=windows") ||
|
||||||
|
putenv ("WINETEST_DEBUG=1") ||
|
||||||
|
putenv ("WINETEST_INTERACTIVE=0") ||
|
||||||
|
putenv ("WINETEST_REPORT_SUCCESS=0")))
|
||||||
|
report (R_FATAL, "Could not reset environment: %d", errno);
|
||||||
|
|
||||||
report (R_STATUS, "Starting up");
|
report (R_STATUS, "Starting up");
|
||||||
logname = run_tests (NULL, tag, url);
|
logname = run_tests (logname, tag);
|
||||||
if (report (R_ASK, MB_YESNO, "Do you want to submit the "
|
if (report (R_ASK, MB_YESNO, "Do you want to submit the "
|
||||||
"test results?") == IDYES)
|
"test results?") == IDYES)
|
||||||
if (!send_file (logname) && remove (logname))
|
if (!send_file (logname) && remove (logname))
|
||||||
|
|
Loading…
Reference in New Issue