Francois Gouget : testbot/TestWTBS: Do not allow nested $TestInfo structures.

Alexandre Julliard julliard at winehq.org
Thu Jan 21 16:02:11 CST 2021


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Jan 21 11:16:11 2021 +0100

testbot/TestWTBS: Do not allow nested $TestInfo structures.

Enforce $TestInfo to be of the form $TestInfo->{category}->{property}.
Having $TestInfo->{category}->{subcategory}->{property} would make the
propagation code more complex and would require documentation regarding
how the subcategory properties get merged.
That means properties cannot be hashtables, except in the case of the
errors-matching properties since their value is a LoadLogErrors()
structure.

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

---

 testbot/tests/TestWTBS | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index e8d8f3f..5f62d63 100755
--- a/testbot/tests/TestWTBS
+++ b/testbot/tests/TestWTBS
@@ -330,12 +330,24 @@ sub LoadTestInfo($)
     my ($Src, $TaskTypes) = @$Pair;
     foreach my $Field (keys %{$TestInfo->{$Src}})
     {
+      my $SrcVal = $TestInfo->{$Src}->{$Field};
+      if (ref($SrcVal) eq "HASH" and $Field !~ /\.errors$/)
+      {
+        # Simply propagating hashtable references would result in changes to
+        # win32 to impact the parent win / test parent which is not what we
+        # want. So subsets of properties are not supported.
+        # .errors properties are the exception because their values are a
+        # LoadLogErrors() structure. As a result they are read-only, and are
+        # not merged.
+        fail("internal error: $Src.$Field should not be a hash in $FileName");
+        next;
+      }
       foreach my $TaskType (@$TaskTypes)
       {
         my $TaskInfo = $TestInfo->{$TaskType};
         if (!defined $TaskInfo->{$Field})
         {
-          $TaskInfo->{$Field} = $TestInfo->{$Src}->{$Field};
+          $TaskInfo->{$Field} = $SrcVal;
         }
       }
     }
@@ -404,6 +416,10 @@ the test suite, then one could also issue the following check:
 
 p tests.TestFailures 2
 
+Finally, note that while the error directives are inherited by subcategories,
+they are not merged. So if if both win and win32 have error-matching
+directives, win32 will not inherit anything from the win category.
+
 =cut
 
 sub CheckLogErrors($$$)




More information about the wine-cvs mailing list