Francois Gouget : testbot/reporttest: Fix the test stubs.

Alexandre Julliard julliard at winehq.org
Tue Feb 9 15:47:09 CST 2021


Module: tools
Branch: master
Commit: 669d6beb14fb655a483a18bba7078c9778aac753
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=669d6beb14fb655a483a18bba7078c9778aac753

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Feb  9 03:14:22 2021 +0100

testbot/reporttest: Fix the test stubs.

Fix the generated source file path and automatically select the dlls or
programs root directory.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/src/reporttest/report.template |  1 +
 testbot/src/reporttest/reporttest.c    | 19 ++++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/testbot/src/reporttest/report.template b/testbot/src/reporttest/report.template
index 560c8b2..dc4b397 100644
--- a/testbot/src/reporttest/report.template
+++ b/testbot/src/reporttest/report.template
@@ -210,6 +210,7 @@ Dll info:
 Test output:
 stub advapi32:cred
 ----- WTBS Simple test patch
+----- Stubs automatically generate a successful dlls or programs test.
 ----- Expected assessement: Success
 
 advapi32:crypt start dlls/advapi32/tests/crypt.c -
diff --git a/testbot/src/reporttest/reporttest.c b/testbot/src/reporttest/reporttest.c
index d2364c9..67dca24 100644
--- a/testbot/src/reporttest/reporttest.c
+++ b/testbot/src/reporttest/reporttest.c
@@ -240,6 +240,9 @@ int main(int argc, char** argv)
         }
         else if (strncmp(line, "stub ", 5) == 0)
         {
+            char* root;
+            char* module = line + 5;
+            int dirlen;
             char* unit = strchr(line, ':');
             if (!unit)
             {
@@ -249,12 +252,22 @@ int main(int argc, char** argv)
             }
             *unit = '\0';
             unit++;
-            unit[strlen(unit)-1] = '\0';
-            fprintf(logfile, "%s:%s start fake/%s/%s.c -\n", line+5, unit, line+5, unit);
+            unit[strlen(unit)-1] = '\0'; /* strip the \r */
+
+            dirlen = strlen(module);
+            if (strstr(module, ".exe"))
+            {
+                dirlen -= 4;
+                root = "programs";
+            }
+            else
+                root = strstr(module, ".com") ? "programs" : "dlls";
+
+            fprintf(logfile, "%s:%s start %s/%.*s/tests/%s.c -\n", module, unit, root, dirlen, module, unit);
             fprintf(logfile, "----- A standard successful test unit\n");
             fprintf(logfile, "----- Expected assessment: Success\n");
             fprintf(logfile, "1234:%s: 2 tests executed (0 marked as todo, 0 failures), 0 skipped.\n", unit);
-            fprintf(logfile, "%s:%s:1234 done (0) in 0s\n", line+5, unit);
+            fprintf(logfile, "%s:%s:1234 done (0) in 0s\n", module, unit);
         }
         else
         {




More information about the wine-cvs mailing list