stas 2003/01/15 18:39:13
Modified: perl-framework/Apache-Test/lib/Apache TestConfigPerl.pm
Log:
implement a more robust autogenerated client .t test in
Apache::TestConfigPerl. Before this fix if the server side returned
500, the test would get skipped, not good. Now it will die a horrible
death.
Revision Changes Path
1.61 +9 -2
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
Index: TestConfigPerl.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- TestConfigPerl.pm 1 Jan 2003 03:47:37 -0000 1.60
+++ TestConfigPerl.pm 16 Jan 2003 02:39:13 -0000 1.61
@@ -83,8 +83,15 @@
my $fh = $self->genfile($t);
print $fh <<EOF;
-use Apache::TestRequest 'GET_BODY';
-print GET_BODY "/$pm";
+use Apache::TestRequest 'GET';
+my \$res = GET "/$pm";
+if (\$res->is_success) {
+ print \$res->content;
+}
+else {
+ die "server side has failed (response code: ", \$res->code, "),\\n",
+ "see t/logs/error_log for more details\\n";
+}
EOF
close $fh or die "close $t: $!";