Alexandre Julliard : winetest: Don't submit test results if we don' t have a valid git build id.

Alexandre Julliard julliard at winehq.org
Tue May 27 06:03:36 CDT 2008


Module: wine
Branch: master
Commit: 9f74bf1eb27a911c6400b53ef7d341fd71a3b7ae
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9f74bf1eb27a911c6400b53ef7d341fd71a3b7ae

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue May 27 11:48:50 2008 +0200

winetest: Don't submit test results if we don't have a valid git build id.

---

 programs/winetest/main.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index b83d03c..7d61da5 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -54,6 +54,7 @@ static struct wine_test *wine_tests;
 static int nr_of_files, nr_of_tests;
 static const char whitespace[] = " \t\r\n";
 static const char testexe[] = "_test.exe";
+static char build_id[64];
 
 static char * get_file_version(char * file_name)
 {
@@ -462,7 +463,6 @@ run_tests (char *logname)
     int logfile;
     char *strres, *eol, *nextline;
     DWORD strsize;
-    char build[64];
 
     SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
 
@@ -499,9 +499,7 @@ run_tests (char *logname)
     report (R_DIR, tempdir);
 
     xprintf ("Version 4\n");
-    xprintf ("Tests from build ");
-    if (LoadStringA( 0, IDS_BUILD_ID, build, sizeof(build) )) xprintf( "%s\n", build );
-    else xprintf ("-\n");
+    xprintf ("Tests from build %s\n", build_id[0] ? build_id : "-" );
     strres = extract_rcdata (MAKEINTRESOURCE(TESTS_URL), STRINGRES, &strsize);
     xprintf ("Archive: ");
     if (strres) xprintf ("%.*s", strsize, strres);
@@ -593,6 +591,8 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
     int poweroff = 0;
     int interactive = 1;
 
+    if (!LoadStringA( 0, IDS_BUILD_ID, build_id, sizeof(build_id) )) build_id[0] = 0;
+
     cmdLine = strtok (cmdLine, whitespace);
     while (cmdLine) {
         if (cmdLine[0] != '-' || cmdLine[2]) {
@@ -676,10 +676,14 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
         }
         report (R_TAG);
 
+        if (!build_id[0])
+            report( R_WARNING, "You won't be able to submit results without a valid build id.\n"
+                    "To submit results, winetest needs to be built from a git checkout." );
+
         if (!logname) {
             logname = run_tests (NULL);
-            if (report (R_ASK, MB_YESNO, "Do you want to submit the "
-                        "test results?") == IDYES)
+            if (build_id[0] &&
+                report (R_ASK, MB_YESNO, "Do you want to submit the test results?") == IDYES)
                 if (!send_file (logname) && remove (logname))
                     report (R_WARNING, "Can't remove logfile: %d.", errno);
             free (logname);




More information about the wine-cvs mailing list