From 1fb75dcac5c053ab7e3a7e6f9ca8518ccd7a34b8 Mon Sep 17 00:00:00 2001 From: Ferenc Wagner Date: Thu, 22 Apr 2004 23:43:54 +0000 Subject: [PATCH] - constify some strings - introduce -u option to write archive url into the report - bump output format version to 3 --- programs/winetest/main.c | 22 +++++++++++++--------- programs/winetest/util.c | 4 ++-- programs/winetest/winetest.h | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/programs/winetest/main.c b/programs/winetest/main.c index 61bf57f7008..a4cc6094856 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -393,7 +393,7 @@ EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType, } 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; char *tempdir; @@ -423,7 +423,7 @@ run_tests (char *logname, const char *tag) report (R_FATAL, "Can't redirect stdout."); fclose (logfile); - xprintf ("Version 2\n"); + xprintf ("Version 3\n"); i = LoadStringA (GetModuleHandle (NULL), 0, build_tag, sizeof build_tag); if (i == 0) report (R_FATAL, "Build descriptor not found: %d", @@ -431,6 +431,7 @@ run_tests (char *logname, const char *tag) if (i >= sizeof build_tag) report (R_FATAL, "Build descriptor too long."); xprintf ("Tests from build %s\n", build_tag); + xprintf ("Archive: %s\n", url?url:""); xprintf ("Tag: %s\n", tag?tag:""); xprintf ("Operating system version:\n"); print_version (); @@ -484,7 +485,8 @@ Usage: winetest [OPTION]...\n\n\ -q quiet mode, no output at all\n\ -o FILE put report into FILE, do not submit\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. */ @@ -515,8 +517,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdLine, int cmdShow) { char *logname = NULL; - char *tag = NULL, *cp; - const char *submit = NULL; + const char *cp, *submit = NULL, *tag = NULL, *url = NULL; /* initialize the revision information first */ extract_rev_infos(); @@ -540,13 +541,13 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, break; case 's': submit = mystrtok (NULL); - if (tag) - report (R_WARNING, "ignoring tag for submit"); + if (tag||url) + report (R_WARNING, "ignoring tag and url for submit"); send_file (submit); break; case 'o': logname = mystrtok (NULL); - run_tests (logname, tag); + run_tests (logname, tag, url); break; case 't': tag = mystrtok (NULL); @@ -557,6 +558,9 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, exit (2); } break; + case 'u': + url = mystrtok (NULL); + break; default: report (R_ERROR, "invalid option: -%c", cmdLine[1]); usage (); @@ -566,7 +570,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, } if (!logname && !submit) { 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 " "test results?") == IDYES) if (!send_file (logname) && remove (logname)) diff --git a/programs/winetest/util.c b/programs/winetest/util.c index 1d6a47454c4..94da1e8406c 100644 --- a/programs/winetest/util.c +++ b/programs/winetest/util.c @@ -103,8 +103,8 @@ void xprintf (const char *fmt, ...) free (buffer); } -char * -badtagchar (char *tag) +const char * +badtagchar (const char *tag) { while (*tag) if (('a'<=*tag && *tag<='z') || diff --git a/programs/winetest/winetest.h b/programs/winetest/winetest.h index f4dcd5c69d0..22dbad07a7b 100644 --- a/programs/winetest/winetest.h +++ b/programs/winetest/winetest.h @@ -33,7 +33,7 @@ void *xrealloc (void *op, size_t len); void xprintf (const char *fmt, ...); char *vstrmake (size_t *lenp, va_list ap); char *strmake (size_t *lenp, ...); -char *badtagchar (char *tag); +const char *badtagchar (const char *tag); int send_file (const char *name);