Francois Gouget : testbot: Tweak the Failure::Validate() error message.
Alexandre Julliard
julliard at winehq.org
Tue Jul 5 15:51:23 CDT 2022
Module: tools
Branch: master
Commit: 77c64eb821f81b4b3db8693096ce52dbf92b5d9f
URL: https://source.winehq.org/git/tools.git/?a=commit;h=77c64eb821f81b4b3db8693096ce52dbf92b5d9f
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Jul 5 17:51:23 2022 +0200
testbot: Tweak the Failure::Validate() error message.
The error message should indicate why the regular expression is invalid.
Also use the field's actual display name instead of making one up.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/lib/WineTestBot/Failures.pm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/testbot/lib/WineTestBot/Failures.pm b/testbot/lib/WineTestBot/Failures.pm
index 6190ef25..8d41bfcc 100644
--- a/testbot/lib/WineTestBot/Failures.pm
+++ b/testbot/lib/WineTestBot/Failures.pm
@@ -98,20 +98,21 @@ sub Validate($)
{
return ("TestUnit", "The test unit '". $self->TestUnit ."' contains invalid characters");
}
- foreach my $Pair (["ConfigRegExp", "configuration"],
- ["FailureRegExp", "failure"])
+ foreach my $Field ("ConfigRegExp", "FailureRegExp")
{
- my ($Field, $Name) = @$Pair;
my $RegExp = $self->$Field;
my $ErrMessage = eval {
use warnings FATAL => qw(regexp);
if ($RegExp and "" =~ /$RegExp/)
{
- return "The $Name regular expression should not match empty strings";
+ return "The regular expression should not match empty strings";
}
- };
- $ErrMessage = "The $Name regular expression is invalid" if ($@);
- return ($Field, $ErrMessage) if ($ErrMessage);
+ } || "$@";
+ if ($ErrMessage)
+ {
+ my $DisplayName = $self->GetPropertyDescriptorByName($Field)->GetDisplayName();
+ return ($Field, "$DisplayName: $ErrMessage");
+ }
}
return $self->SUPER::Validate();
}
More information about the wine-cvs
mailing list