[1/2] winetest: Add a trace in the log when skipping a subtest.

Francois Gouget fgouget at free.fr
Thu Dec 9 05:05:19 CST 2010


Note that when skipping a whole test executable no trace is added because run_tests() does not know about those.
---

The added trace is of the form:

ntdll:atom skipped dlls/ntdll/tests/atom.c -

So it needs to know the test and subtest names.

I'm not happy with the situation when we skip a whole test executable. 
One issue is that in such a case we don't even extract the executable 
right now, thus making it impossible to print the subtest name. So we'd 
need a different skip line format for that case. Or we could decide to 
extract all the files and query their subtest names anyway and only 
disable actually running the tests.


 programs/winetest/main.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 883006c..6f922ef 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -575,8 +575,7 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name)
             test->subtests = heap_realloc (test->subtests,
                                            allocated * sizeof(char*));
         }
-        if (!test_filtered_out( test->name, index ))
-            test->subtests[test->subtest_count++] = heap_strdup(index);
+        test->subtests[test->subtest_count++] = heap_strdup(index);
         index = strtok (NULL, whitespace);
     }
     test->subtests = heap_realloc (test->subtests,
@@ -592,14 +591,23 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name)
 static void
 run_test (struct wine_test* test, const char* subtest, HANDLE out_file, const char *tempdir)
 {
-    int status;
     const char* file = get_test_source_file(test->name, subtest);
-    char *cmd = strmake (NULL, "%s %s", test->exename, subtest);
 
-    xprintf ("%s:%s start %s -\n", test->name, subtest, file);
-    status = run_ex (cmd, out_file, tempdir, 120000);
-    heap_free (cmd);
-    xprintf ("%s:%s done (%d)\n", test->name, subtest, status);
+    if (test_filtered_out( test->name, subtest ))
+    {
+        report (R_STEP, "Skipping: %s:%s", test->name, subtest);
+        xprintf ("%s:%s skipped %s -\n", test->name, subtest, file);
+    }
+    else
+    {
+        int status;
+        char *cmd = strmake (NULL, "%s %s", test->exename, subtest);
+        report (R_STEP, "Running: %s:%s", test->name, subtest);
+        xprintf ("%s:%s start %s -\n", test->name, subtest, file);
+        status = run_ex (cmd, out_file, tempdir, 120000);
+        heap_free (cmd);
+        xprintf ("%s:%s done (%d)\n", test->name, subtest, status);
+    }
 }
 
 static BOOL CALLBACK
@@ -924,9 +932,7 @@ run_tests (char *logname, char *outdir)
 
 	for (j = 0; j < test->subtest_count; j++) {
             if (aborting) break;
-            report (R_STEP, "Running: %s:%s", test->name,
-                    test->subtests[j]);
-	    run_test (test, test->subtests[j], logfile, tempdir);
+            run_test (test, test->subtests[j], logfile, tempdir);
         }
 
         if (test->maindllpath) {
-- 
1.7.2.3




More information about the wine-patches mailing list