Commit 1fb75dca authored by Ferenc Wagner's avatar Ferenc Wagner Committed by Alexandre Julliard

- constify some strings

- introduce -u option to write archive url into the report - bump output format version to 3
parent 72aad7dc
...@@ -393,7 +393,7 @@ EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType, ...@@ -393,7 +393,7 @@ EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType,
} }
char * char *
run_tests (char *logname, const char *tag) run_tests (char *logname, const char *tag, const char *url)
{ {
int nr_of_files = 0, nr_of_tests = 0, i; int nr_of_files = 0, nr_of_tests = 0, i;
char *tempdir; char *tempdir;
...@@ -423,7 +423,7 @@ run_tests (char *logname, const char *tag) ...@@ -423,7 +423,7 @@ run_tests (char *logname, const char *tag)
report (R_FATAL, "Can't redirect stdout."); report (R_FATAL, "Can't redirect stdout.");
fclose (logfile); fclose (logfile);
xprintf ("Version 2\n"); xprintf ("Version 3\n");
i = LoadStringA (GetModuleHandle (NULL), 0, i = LoadStringA (GetModuleHandle (NULL), 0,
build_tag, sizeof build_tag); build_tag, sizeof build_tag);
if (i == 0) report (R_FATAL, "Build descriptor not found: %d", if (i == 0) report (R_FATAL, "Build descriptor not found: %d",
...@@ -431,6 +431,7 @@ run_tests (char *logname, const char *tag) ...@@ -431,6 +431,7 @@ run_tests (char *logname, const char *tag)
if (i >= sizeof build_tag) if (i >= sizeof build_tag)
report (R_FATAL, "Build descriptor too long."); report (R_FATAL, "Build descriptor too long.");
xprintf ("Tests from build %s\n", build_tag); xprintf ("Tests from build %s\n", build_tag);
xprintf ("Archive: %s\n", url?url:"");
xprintf ("Tag: %s\n", tag?tag:""); xprintf ("Tag: %s\n", tag?tag:"");
xprintf ("Operating system version:\n"); xprintf ("Operating system version:\n");
print_version (); print_version ();
...@@ -484,7 +485,8 @@ Usage: winetest [OPTION]...\n\n\ ...@@ -484,7 +485,8 @@ Usage: winetest [OPTION]...\n\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. */
...@@ -515,8 +517,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, ...@@ -515,8 +517,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
LPSTR cmdLine, int cmdShow) LPSTR cmdLine, int cmdShow)
{ {
char *logname = NULL; char *logname = NULL;
char *tag = NULL, *cp; const char *cp, *submit = NULL, *tag = NULL, *url = NULL;
const char *submit = NULL;
/* initialize the revision information first */ /* initialize the revision information first */
extract_rev_infos(); extract_rev_infos();
...@@ -540,13 +541,13 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, ...@@ -540,13 +541,13 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
break; break;
case 's': case 's':
submit = mystrtok (NULL); submit = mystrtok (NULL);
if (tag) if (tag||url)
report (R_WARNING, "ignoring tag for submit"); report (R_WARNING, "ignoring tag and url for submit");
send_file (submit); send_file (submit);
break; break;
case 'o': case 'o':
logname = mystrtok (NULL); logname = mystrtok (NULL);
run_tests (logname, tag); run_tests (logname, tag, url);
break; break;
case 't': case 't':
tag = mystrtok (NULL); tag = mystrtok (NULL);
...@@ -557,6 +558,9 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, ...@@ -557,6 +558,9 @@ 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 ();
...@@ -566,7 +570,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, ...@@ -566,7 +570,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
} }
if (!logname && !submit) { if (!logname && !submit) {
report (R_STATUS, "Starting up"); report (R_STATUS, "Starting up");
logname = run_tests (NULL, tag); logname = run_tests (NULL, tag, url);
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))
......
...@@ -103,8 +103,8 @@ void xprintf (const char *fmt, ...) ...@@ -103,8 +103,8 @@ void xprintf (const char *fmt, ...)
free (buffer); free (buffer);
} }
char * const char *
badtagchar (char *tag) badtagchar (const char *tag)
{ {
while (*tag) while (*tag)
if (('a'<=*tag && *tag<='z') || if (('a'<=*tag && *tag<='z') ||
......
...@@ -33,7 +33,7 @@ void *xrealloc (void *op, size_t len); ...@@ -33,7 +33,7 @@ void *xrealloc (void *op, size_t len);
void xprintf (const char *fmt, ...); void xprintf (const char *fmt, ...);
char *vstrmake (size_t *lenp, va_list ap); char *vstrmake (size_t *lenp, va_list ap);
char *strmake (size_t *lenp, ...); char *strmake (size_t *lenp, ...);
char *badtagchar (char *tag); const char *badtagchar (const char *tag);
int send_file (const char *name); int send_file (const char *name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment