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@codeweavers.com --- testbot/tests/TestWTBS | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS index e8d8f3f6..5f62d634 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($$$)