Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest
In directory usw-pr-cvs1:/tmp/cvs-serv6159/lib/HTTP/WebTest
Modified Files:
API.pm
Log Message:
Now HTTP::WebTest do validates global test parameters.
Index: API.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** API.pm 2002/01/28 06:32:02 1.2
--- API.pm 2002/01/28 07:11:05 1.3
***************
*** 103,106 ****
--- 103,119 ----
$self->_global_test_params($params);
+ # validate global test parameters
+ my %checks = $self->validate_params($params);
+ # be sure that checks are sorted by param name
+ my @broken = grep { not $_->ok } map $checks{$_}, sort keys %checks;
+
+ # is is hard to report errors nicely (i.e. via report plugins)
+ # here because plugins are not initialized yet. Just die right now
+ # if there are any bad global test parameters
+ if(@broken) {
+ my $die = join "\n", 'HTTP::WebTest:', map $_->comment, @broken;
+ die $die;
+ }
+
# start tests hook
for my $plugin (@{$self->plugins}) {
|