[tools] winetest/dissect: Fix handling of subtest lines.

Francois Gouget fgouget at codeweavers.com
Fri Mar 5 05:19:51 CST 2021


Add support for garbled subtest lines.
Link to the corresponding source line.
Call add_test_line() so they show up in the HTML-ized report.
Let check_unit() issue an error if they are misplaced.
Tweak the check_unit() message since subtest lines are not really
"messages".

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 winetest/dissect | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/winetest/dissect b/winetest/dissect
index 7f4f3271d..797c204b3 100755
--- a/winetest/dissect
+++ b/winetest/dissect
@@ -480,7 +480,7 @@ sub check_unit($$)
     my ($l_unit, $l_type) = @_;
     if (!$units{$l_unit} and !$broken)
     {
-        add_test_line("end", "Misplaced $l_type message");
+        add_test_line("end", "Misplaced $l_type line");
         $extra_failures++;
         $broken = 1;
     }
@@ -609,19 +609,17 @@ while ($line = <IN>) {
             $rc = 0;
         }
     }
-    elsif ($line =~ /^([_.a-z0-9-]+)\.c:\d+: Subtest ([_.a-z0-9-]+)$/)
+    elsif (($unit ne "" and
+            $line =~ /^(.*?)($units_re)\.c:(\d+): (Subtest ([_.a-z0-9-]+).*)$/) or
+           $line =~ /^()([_a-z0-9]+)\.c:(\d+): (Subtest ([_.a-z0-9-]+).*)$/)
     {
-        my ($l_unit, $l_subunit) = ($1, $2);
-        if ($units{$l_unit})
-        {
-            $units{$l_subunit} = 1;
-            $units_re = join("|", keys %units);
-        }
-        else
-        {
-            add_test_line("end", "$l_unit has a misplaced $l_subunit subtest line\n");
-            $extra_failures++;
-        }
+        my ($pollution, $l_unit, $l_num, $l_text, $l_subunit) = ($1, $2, $3, $4, $5);
+        add_test_line("trace", escapeHTML($pollution) .
+                               get_source_link($l_unit, $l_num) .": ".
+                               escapeHTML($l_text));
+        check_unit($l_unit, "subtest");
+        $units{$l_subunit} = 1;
+        $units_re = join("|", keys %units);
     }
     elsif (($unit ne "" and
             $line =~ /^(.*?)($units_re)\.c:(\d+): (Test (?:failed|succeeded inside todo block): .*)$/) or
-- 
2.20.1




More information about the wine-devel mailing list