Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory sc8-pr-cvs1:/tmp/cvs-serv23077/t
Modified Files:
02-generic.t
Log Message:
Test 'timeout' test parameter
Index: 02-generic.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/02-generic.t,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** 02-generic.t 18 Nov 2002 08:04:49 -0000 1.19
--- 02-generic.t 18 Nov 2002 08:40:57 -0000 1.20
***************
*** 16,20 ****
require 't/utils.pl';
! BEGIN { plan tests => 34 }
# init tests
--- 16,20 ----
require 't/utils.pl';
! BEGIN { plan tests => 35 }
# init tests
***************
*** 643,646 ****
--- 643,677 ----
opts => $opts,
check_file => 't/test.out/relative_urls');
+ }
+
+ # 35: run timeout tests
+ {
+ if(defined $ENV{TEST_FAST}) {
+ skip('skip: long response time tests are disabled', 1);
+ } else {
+ my $tests = [ { url => abs_url($URL, '/sleep-2'),
+ max_rtime => 10,
+ timeout => 4 },
+ { url => abs_url($URL, '/sleep-3'),
+ max_rtime => 10,
+ timeout => 2 },
+ { url => abs_url($URL, '/sleep-4'),
+ max_rtime => 10,
+ timeout => 1 },
+ ];
+
+ my $out_filter = sub {
+ $_[0] =~ s|( Response \s+ time \s+ \( \s+ )
+ ( \d+ \. ) ( \d+ )
+ ( \s+ \) )
+ |"$1$2" . ('0' x length($3)) . "$4"|xge;
+ };
+
+ check_webtest(webtest => $WEBTEST,
+ server_url => $URL,
+ tests => $tests,
+ check_file => 't/test.out/timeout',
+ out_filter => $out_filter);
+ }
}
|