winetest: carry along the archive url

Ferenc Wagner wferi at afavant.elte.hu
Wed Apr 21 21:17:14 CDT 2004


ChangeLog:
- constify some strings
- introduce -u option to write archive url into the report
- bump output format version to 3

Feri.

Index: main.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/main.c,v
retrieving revision 1.11
diff -u -r1.11 main.c
--- main.c	20 Apr 2004 04:00:07 -0000	1.11
+++ main.c	22 Apr 2004 01:59:51 -0000
@@ -393,7 +408,7 @@
 }
 
 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 +438,7 @@
         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 +446,7 @@
     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 +500,8 @@
   -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 +532,7 @@
                     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 +556,13 @@
             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 +573,9 @@
                 exit (2);
             }
             break;
+        case 'u':
+            url = mystrtok (NULL);
+            break;
         default:
             report (R_ERROR, "invalid option: -%c", cmdLine[1]);
             usage ();
@@ -566,7 +585,7 @@
     }
     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))
Index: util.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/util.c,v
retrieving revision 1.6
diff -u -r1.6 util.c
--- util.c	13 Apr 2004 00:19:38 -0000	1.6
+++ util.c	22 Apr 2004 01:59:51 -0000
@@ -103,8 +103,8 @@
     free (buffer);
 }
 
-char *
-badtagchar (char *tag)
+const char *
+badtagchar (const char *tag)
 {
     while (*tag)
         if (('a'<=*tag && *tag<='z') ||
Index: winetest.h
===================================================================
RCS file: /home/wine/wine/programs/winetest/winetest.h,v
retrieving revision 1.3
diff -u -r1.3 winetest.h
--- winetest.h	19 Feb 2004 04:12:42 -0000	1.3
+++ winetest.h	22 Apr 2004 01:59:51 -0000
@@ -33,7 +33,7 @@
 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);
 



More information about the wine-patches mailing list