Return-Path: Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 79058 invoked by uid 500); 24 May 2003 10:08:25 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 79045 invoked from network); 24 May 2003 10:08:25 -0000 Received: from vesta.ectoplasm.org (64.49.222.108) by daedalus.apache.org with SMTP; 24 May 2003 10:08:25 -0000 Received: from [10.0.0.200] (bb-203-125-28-185.singnet.com.sg [203.125.28.185]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by vesta.ectoplasm.org (Postfix) with ESMTP id 77DA6A45BD; Sat, 24 May 2003 05:08:33 -0500 (CDT) Subject: [mp1] s/Apache::test/Apache::testold/g From: "Philippe M. Chiasson" To: Stas Bekman Cc: Geoffrey Young , dev@perl.apache.org In-Reply-To: <3ECDEEF8.8090406@stason.org> References: <1053591600.8160.20.camel@shou.sg.ectoplasm.org> <3ECCCD82.6000705@modperlcookbook.org> <3ECD7A31.9090507@stason.org> <3ECDEEF8.8090406@stason.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-y9hxjHXVBQOMF1qr64Dg" Organization: Message-Id: <1053770909.11789.11.camel@shou.sg.ectoplasm.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 24 May 2003 18:08:30 +0800 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --=-y9hxjHXVBQOMF1qr64Dg Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2003-05-23 at 17:50, Stas Bekman wrote: > Stas Bekman wrote: > > Geoffrey Young wrote: > >=20 > >>> So, unless anybody objects today, I'll be posting the current mp1's > >>> status on (dev|modperl)@perl.apache.org to see if people can come up > >>> with other issues that could/should be slapped into 1.28. > >> > >> > >> > >> the Apache::test stuff definitely needs to be in there. > >=20 > >=20 > > so we need to rename Apache/test.pm with Apache/testold.pm and adjust=20 > > all the tests. >=20 > And also remember to add $VERSION to Apache/testold.pm, because it doesn'= t=20 > have one now. 0.01 will do ;) >=20 > Please log all these to the STAtuS file so we don't forget anything. How about simply applying this patch? If I understood this thread correctly, we just need to stop using "Apache::test" in mp1 to avoid clashes of all sort. # $Id: testold.patch,v 1.1 2003/05/24 10:06:24 gozer Exp $ Rename Apache::test to Apache::testold Index: MANIFEST =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/MANIFEST,v retrieving revision 1.70 diff -u -I$Id -r1.70 MANIFEST --- MANIFEST 24 Mar 2002 03:02:44 -0000 1.70 +++ MANIFEST 24 May 2003 10:04:28 -0000 @@ -40,7 +40,7 @@ lib/mod_perl.pm lib/Apache/src.pm lib/Apache/httpd_conf.pm -lib/Apache/test.pm +lib/Apache/testold.pm lib/Apache/Debug.pm lib/Apache/ExtUtils.pm lib/Apache/FakeRequest.pm Index: t/TEST =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/TEST,v retrieving revision 1.12 diff -u -I$Id -r1.12 TEST --- t/TEST 14 Mar 2003 06:51:58 -0000 1.12 +++ t/TEST 24 May 2003 10:04:28 -0000 @@ -68,8 +68,8 @@ } =20 unshift @INC, '.'; -require Apache::test; -Apache::test->import('simple_fetch'); +require Apache::testold; +Apache::testold->import('simple_fetch'); use subs 'simple_fetch'; =20 unless (simple_fetch "/test.html") { Index: t/internal/api.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/api.t,v retrieving revision 1.2 diff -u -I$Id -r1.2 api.t --- t/internal/api.t 29 May 2002 16:26:49 -0000 1.2 +++ t/internal/api.t 24 May 2003 10:04:28 -0000 @@ -1,3 +1,3 @@ -use Apache::test; +use Apache::testold; =20 print fetch "http://$net::httpserver$net::perldir/api.pl?arg1=3Done&arg2= =3Dtwo"; Index: t/internal/auth.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/auth.t,v retrieving revision 1.3 diff -u -I$Id -r1.3 auth.t --- t/internal/auth.t 14 Dec 1998 23:34:01 -0000 1.3 +++ t/internal/auth.t 24 May 2003 10:04:28 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; =20 my $ua =3D Apache::UserAgent->new; my $url =3D URI::URL->new("http://$net::httpserver/auth/.htaccess"); Index: t/internal/croak.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/croak.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 croak.t --- t/internal/croak.t 1 Oct 1998 03:21:49 -0000 1.1 +++ t/internal/croak.t 24 May 2003 10:04:28 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; =20 my $i =3D 0; print "1..12\n"; Index: t/internal/dirmagic.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/dirmagic.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 dirmagic.t --- t/internal/dirmagic.t 28 Aug 1998 22:33:34 -0000 1.1 +++ t/internal/dirmagic.t 24 May 2003 10:04:28 -0000 @@ -1,3 +1,3 @@ -use Apache::test; +use Apache::testold; =20 print fetch "/dirmagic"; Index: t/internal/error.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/error.t,v retrieving revision 1.5 diff -u -I$Id -r1.5 error.t --- t/internal/error.t 6 Oct 2000 20:18:25 -0000 1.5 +++ t/internal/error.t 24 May 2003 10:04:28 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; #we're testing an experimental feature that doesn't work for some folks #will revisit later unless (defined $ENV{USER} and $ENV{USER} eq 'dougm') { Index: t/internal/headers.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/headers.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 headers.t --- t/internal/headers.t 6 Dec 1997 17:57:13 -0000 1.1 +++ t/internal/headers.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 if($] < 5.003_02) { print "1..1\nok 1;\n"; Index: t/internal/http-get.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/http-get.t,v retrieving revision 1.8 diff -u -I$Id -r1.8 http-get.t --- t/internal/http-get.t 29 Jan 2001 19:49:27 -0000 1.8 +++ t/internal/http-get.t 24 May 2003 10:04:28 -0000 @@ -16,7 +16,7 @@ =20 print "1..$num_tests\n"; =20 -use Apache::test; +use Apache::testold; require LWP::UserAgent; =20 my $ua =3D new LWP::UserAgent; # create a useragent to test Index: t/internal/http-post.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/http-post.t,v retrieving revision 1.2 diff -u -I$Id -r1.2 http-post.t --- t/internal/http-post.t 23 Jul 1998 23:06:53 -0000 1.2 +++ t/internal/http-post.t 24 May 2003 10:04:28 -0000 @@ -16,7 +16,7 @@ =20 print "1..$num_tests\n"; =20 -use Apache::test; +use Apache::testold; require LWP::UserAgent; =20 my $ua =3D new LWP::UserAgent; # create a useragent to test Index: t/internal/proxy.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/proxy.t,v retrieving revision 1.4 diff -u -I$Id -r1.4 proxy.t --- t/internal/proxy.t 14 Jul 1998 00:51:41 -0000 1.4 +++ t/internal/proxy.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 #hrm, deal with this later print "1..1\nok 1\n"; Index: t/internal/redirect.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/redirect.t,v retrieving revision 1.5 diff -u -I$Id -r1.5 redirect.t --- t/internal/redirect.t 16 Jul 2001 17:11:04 -0000 1.5 +++ t/internal/redirect.t 24 May 2003 10:04:28 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; use Config; =20 { Index: t/internal/rwrite.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/rwrite.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 rwrite.t --- t/internal/rwrite.t 19 Mar 1998 23:09:04 -0000 1.1 +++ t/internal/rwrite.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 my $sent =3D fetch "/perl/rwrite.pl"; my $i =3D 0; Index: t/internal/stacked.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/stacked.t,v retrieving revision 1.4 diff -u -I$Id -r1.4 stacked.t --- t/internal/stacked.t 14 Dec 1998 23:34:01 -0000 1.4 +++ t/internal/stacked.t 24 May 2003 10:04:28 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; =20 skip_test unless $net::callback_hooks{PERL_STACKED_HANDLERS} and $net::callback_hooks{PERL_FIXUP}; Index: t/internal/table.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/table.t,v retrieving revision 1.2 diff -u -I$Id -r1.2 table.t --- t/internal/table.t 13 Nov 1998 03:27:56 -0000 1.2 +++ t/internal/table.t 24 May 2003 10:04:28 -0000 @@ -1,3 +1,3 @@ -use Apache::test; +use Apache::testold; =20 print fetch "$PERL_DIR/tie_table.pl"; Index: t/internal/taint.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/internal/taint.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 taint.t --- t/internal/taint.t 6 Dec 1997 17:57:16 -0000 1.1 +++ t/internal/taint.t 24 May 2003 10:04:28 -0000 @@ -7,7 +7,7 @@ my $num_tests =3D scalar @tests; print "1..$num_tests\n"; =20 -use Apache::test; +use Apache::testold; =20 my $ua =3D new LWP::UserAgent; # create a useragent to test =20 Index: t/modules/actions.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/actions.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 actions.t --- t/modules/actions.t 6 Dec 1997 17:57:20 -0000 1.1 +++ t/modules/actions.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 my $ua =3D LWP::UserAgent->new; # create a useragent to test =20 Index: t/modules/cgi.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/cgi.t,v retrieving revision 1.8 diff -u -I$Id -r1.8 cgi.t --- t/modules/cgi.t 23 Dec 2000 00:04:36 -0000 1.8 +++ t/modules/cgi.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 skip_test unless have_module "CGI"; =20 Index: t/modules/constants.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/constants.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 constants.t --- t/modules/constants.t 6 Dec 1997 17:57:25 -0000 1.1 +++ t/modules/constants.t 24 May 2003 10:04:28 -0000 @@ -1,3 +1,3 @@ -use Apache::test; +use Apache::testold; =20 print fetch "http://$net::httpserver$net::perldir/constants.pl"; Index: t/modules/cookie.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/cookie.t,v retrieving revision 1.5 diff -u -I$Id -r1.5 cookie.t --- t/modules/cookie.t 26 Mar 1999 20:23:13 -0000 1.5 +++ t/modules/cookie.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ use strict; -use Apache::test; +use Apache::testold; use Apache::src (); =20 my $Is_dougm =3D (defined($ENV{USER}) && ($ENV{USER} eq "dougm")); Index: t/modules/embperl.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/embperl.t,v retrieving revision 1.6 diff -u -I$Id -r1.6 embperl.t --- t/modules/embperl.t 21 Jan 1999 17:04:14 -0000 1.6 +++ t/modules/embperl.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ use Apache::src (); -use Apache::test; +use Apache::testold; =20 skip_test unless have_module "HTML::Embperl"; =20 Index: t/modules/eperl.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/eperl.t,v retrieving revision 1.3 diff -u -I$Id -r1.3 eperl.t --- t/modules/eperl.t 26 Apr 1998 04:34:09 -0000 1.3 +++ t/modules/eperl.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 skip_test unless have_module "Parse::ePerl"; =20 Index: t/modules/file.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/file.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 file.t --- t/modules/file.t 26 Sep 1998 16:08:14 -0000 1.1 +++ t/modules/file.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; skip_test unless have_module "Apache::File"; print fetch "http://$net::httpserver$net::perldir/file.pl"; =20 Index: t/modules/httpdconf.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/httpdconf.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 httpdconf.t --- t/modules/httpdconf.t 22 Dec 1997 11:55:51 -0000 1.1 +++ t/modules/httpdconf.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 $^W=3D0; =20 Index: t/modules/include.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/include.t,v retrieving revision 1.2 diff -u -I$Id -r1.2 include.t --- t/modules/include.t 19 Sep 1998 15:57:21 -0000 1.2 +++ t/modules/include.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; skip_test if $net::callback_hooks{USE_DSO};=20 my $ua =3D LWP::UserAgent->new; # create a useragent to test =20 Index: t/modules/log.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/log.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 log.t --- t/modules/log.t 12 Jul 1998 21:21:38 -0000 1.1 +++ t/modules/log.t 24 May 2003 10:04:28 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 print fetch "http://$net::httpserver$net::perldir/log.pl"; =20 Index: t/modules/module.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/module.t,v retrieving revision 1.3 diff -u -I$Id -r1.3 module.t --- t/modules/module.t 4 Jan 1999 18:06:06 -0000 1.3 +++ t/modules/module.t 24 May 2003 10:04:28 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; use Apache::src (); =20 skip_test unless have_module "Apache::Module";=20 Index: t/modules/perlrun.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/perlrun.t,v retrieving revision 1.2 diff -u -I$Id -r1.2 perlrun.t --- t/modules/perlrun.t 12 May 2000 07:10:58 -0000 1.2 +++ t/modules/perlrun.t 24 May 2003 10:04:28 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; =20 fetch "/dirty-perl/dirty-script.cgi"; =20 Index: t/modules/perlrunxs.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/perlrunxs.t,v retrieving revision 1.3 diff -u -I$Id -r1.3 perlrunxs.t --- t/modules/perlrunxs.t 30 Oct 1998 02:01:32 -0000 1.3 +++ t/modules/perlrunxs.t 24 May 2003 10:04:29 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; =20 skip_test if $] >=3D 5.005; #will fix later skip_test unless $net::callback_hooks{PERL_RUN_XS}; Index: t/modules/psections.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/psections.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 psections.t --- t/modules/psections.t 22 Dec 1997 11:55:52 -0000 1.1 +++ t/modules/psections.t 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 skip_test unless have_module "Data::Dumper"; skip_test unless have_module "Devel::Symdump"; Index: t/modules/request.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/request.t,v retrieving revision 1.10 diff -u -I$Id -r1.10 request.t --- t/modules/request.t 27 Sep 2000 20:04:00 -0000 1.10 +++ t/modules/request.t 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ use strict; -use Apache::test; +use Apache::testold; use Apache::src (); use Cwd qw(fastcwd); =20 Index: t/modules/sandwich.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/sandwich.t,v retrieving revision 1.2 diff -u -I$Id -r1.2 sandwich.t --- t/modules/sandwich.t 4 Aug 1999 01:56:13 -0000 1.2 +++ t/modules/sandwich.t 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 skip_test unless have_module "Apache::Sandwich"; =20 Index: t/modules/src.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/src.t,v retrieving revision 1.4 diff -u -I$Id -r1.4 src.t --- t/modules/src.t 10 Jul 2001 15:45:32 -0000 1.4 +++ t/modules/src.t 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ use ExtUtils::testlib; =20 -use Apache::test; +use Apache::testold; use Apache::src; =20 my $i =3D 0; Index: t/modules/ssi.test =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/ssi.test,v retrieving revision 1.3 diff -u -I$Id -r1.3 ssi.test --- t/modules/ssi.test 23 Apr 2003 02:06:42 -0000 1.3 +++ t/modules/ssi.test 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 skip_test unless fetch("/perl/have_module.pl?mod_include.c"); =20 Index: t/modules/stage.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/stage.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 stage.t --- t/modules/stage.t 6 Dec 1997 17:57:28 -0000 1.1 +++ t/modules/stage.t 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 skip_test unless have_module "Apache::Stage"; =20 Index: t/modules/status.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/status.t,v retrieving revision 1.2 diff -u -I$Id -r1.2 status.t --- t/modules/status.t 3 Jun 1998 15:53:23 -0000 1.2 +++ t/modules/status.t 24 May 2003 10:04:29 -0000 @@ -1,4 +1,4 @@ -use Apache::test; +use Apache::testold; =20 my @tests =3D qw{ script Index: t/modules/symbol.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/symbol.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 symbol.t --- t/modules/symbol.t 10 Feb 1998 21:35:47 -0000 1.1 +++ t/modules/symbol.t 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 skip_test unless have_module "Devel::Symdump"; =20 Index: t/modules/uri.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/uri.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 uri.t --- t/modules/uri.t 17 Jul 1998 20:48:42 -0000 1.1 +++ t/modules/uri.t 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 print fetch "http://$net::httpserver$net::perldir/uri.pl"; =20 Index: t/modules/util.t =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/modules/util.t,v retrieving revision 1.1 diff -u -I$Id -r1.1 util.t --- t/modules/util.t 18 Jul 1998 14:44:17 -0000 1.1 +++ t/modules/util.t 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ =20 -use Apache::test; +use Apache::testold; =20 print fetch "http://$net::httpserver$net::perldir/util.pl"; =20 Index: t/net/perl/api.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/api.pl,v retrieving revision 1.50 diff -u -I$Id -r1.50 api.pl --- t/net/perl/api.pl 19 Jun 2002 16:31:52 -0000 1.50 +++ t/net/perl/api.pl 24 May 2003 10:04:29 -0000 @@ -1,7 +1,7 @@ #!perl use Apache (); use Apache::Constants qw(:server :common :methods); -use Apache::test; +use Apache::testold; use strict; =20 Apache->register_cleanup(sub {0}); @@ -264,7 +264,7 @@ =20 { package Apache::TestDirectives; - use Apache::test 'test'; + use Apache::testold 'test'; my $scfg =3D Apache::ModuleConfig->get($r->server); test ++$i, $scfg; test ++$i, __PACKAGE__->isa($scfg->{ServerClass}); @@ -306,7 +306,7 @@ test ++$i, not $uri; print $@ if $@; =20 -use Apache::test qw($USE_THREAD); +use Apache::testold qw($USE_THREAD); if ($USE_THREAD) { #under Solaris at least, according to Brian P Millett warn "XXX: need to fix \$r->exit in t/net/api w/ threads\n"; Index: t/net/perl/dirty-test.cgi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/dirty-test.cgi,v retrieving revision 1.7 diff -u -I$Id -r1.7 dirty-test.cgi --- t/net/perl/dirty-test.cgi 19 Jun 2002 16:31:52 -0000 1.7 +++ t/net/perl/dirty-test.cgi 24 May 2003 10:04:29 -0000 @@ -12,7 +12,7 @@ =20 package Apache::ROOT::dirty_2dperl::dirty_2dscript_2ecgi; =20 -use Apache::test qw(test); +use Apache::testold qw(test); =20 print "Content-type: text/plain\n\n"; =20 Index: t/net/perl/file.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/file.pl,v retrieving revision 1.8 diff -u -I$Id -r1.8 file.pl --- t/net/perl/file.pl 19 Jun 2002 16:31:52 -0000 1.8 +++ t/net/perl/file.pl 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ #!perl use strict; -use Apache::test; +use Apache::testold; =20 my $r =3D shift; $r->send_http_header('text/plain'); Index: t/net/perl/log.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/log.pl,v retrieving revision 1.5 diff -u -I$Id -r1.5 log.pl --- t/net/perl/log.pl 19 Jun 2002 16:31:52 -0000 1.5 +++ t/net/perl/log.pl 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ #!perl use strict; -use Apache::test; +use Apache::testold; my $i =3D 0; my $r =3D shift; $r->send_http_header("text/plain"); Index: t/net/perl/module.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/module.pl,v retrieving revision 1.3 diff -u -I$Id -r1.3 module.pl --- t/net/perl/module.pl 19 Jun 2002 16:31:52 -0000 1.3 +++ t/net/perl/module.pl 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ #!perl -use Apache::test; +use Apache::testold; =20 my $r =3D shift; $r->send_http_header('text/plain'); Index: t/net/perl/request-cookie.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/request-cookie.pl,v retrieving revision 1.8 diff -u -I$Id -r1.8 request-cookie.pl --- t/net/perl/request-cookie.pl 19 Jun 2002 16:31:52 -0000 1.8 +++ t/net/perl/request-cookie.pl 24 May 2003 10:04:29 -0000 @@ -1,7 +1,7 @@ #!perl use strict; =20 -use Apache::test; +use Apache::testold; =20 eval { require Apache::Request; Index: t/net/perl/request-param.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/request-param.pl,v retrieving revision 1.3 diff -u -I$Id -r1.3 request-param.pl --- t/net/perl/request-param.pl 19 Jun 2002 16:31:52 -0000 1.3 +++ t/net/perl/request-param.pl 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ #!perl use strict; -use Apache::test; +use Apache::testold; =20 my $r =3D shift; $r->send_http_header('text/plain'); Index: t/net/perl/request-upload.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/request-upload.pl,v retrieving revision 1.9 diff -u -I$Id -r1.9 request-upload.pl --- t/net/perl/request-upload.pl 19 Jun 2002 16:31:52 -0000 1.9 +++ t/net/perl/request-upload.pl 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ #!perl use strict; -use Apache::test; +use Apache::testold; =20 my $r =3D shift; $r->send_http_header('text/plain'); Index: t/net/perl/test =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/test,v retrieving revision 1.18 diff -u -I$Id -r1.18 test --- t/net/perl/test 12 Jul 2001 01:32:58 -0000 1.18 +++ t/net/perl/test 24 May 2003 10:04:29 -0000 @@ -5,7 +5,7 @@ use vars qw($Scalar @Array %Hash); #for testing perl-status use vars qw($filename);=20 use Config; -use Apache::test qw($USE_THREAD); +use Apache::testold qw($USE_THREAD); =20 not $filename or die "Apache::Registry scoping is broken!\n"; =20 @@ -41,7 +41,7 @@ =20 $r->post_connection(sub { my $r =3D shift; - unless(Apache::test::WIN32()) { #XXX + unless(Apache::testold::WIN32()) { #XXX my $loc =3D $r->uri; $loc =3D~ /test/i or die "post_connection can't see \$r->uri! ($loc)\n"; } Index: t/net/perl/tie_table.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/tie_table.pl,v retrieving revision 1.12 diff -u -I$Id -r1.12 tie_table.pl --- t/net/perl/tie_table.pl 19 Jun 2002 16:31:52 -0000 1.12 +++ t/net/perl/tie_table.pl 24 May 2003 10:04:29 -0000 @@ -1,5 +1,5 @@ #!perl -use Apache::test; +use Apache::testold; =20 use strict; my $r =3D shift; Index: t/net/perl/uri.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/uri.pl,v retrieving revision 1.2 diff -u -I$Id -r1.2 uri.pl --- t/net/perl/uri.pl 19 Jun 2002 16:31:52 -0000 1.2 +++ t/net/perl/uri.pl 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ #!perl use strict; -use Apache::test; +use Apache::testold; $|++; my $i =3D 0; =20 Index: t/net/perl/util.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/util.pl,v retrieving revision 1.17 diff -u -I$Id -r1.17 util.pl --- t/net/perl/util.pl 20 Feb 2003 07:09:14 -0000 1.17 +++ t/net/perl/util.pl 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ #!perl use strict; -use Apache::test; +use Apache::testold; $|++; my $i =3D 0; my $tests =3D 9; Index: t/net/perl/io/dir_config.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/modperl/t/net/perl/io/dir_config.pl,v retrieving revision 1.3 diff -u -I$Id -r1.3 dir_config.pl --- t/net/perl/io/dir_config.pl 19 Jun 2002 16:31:53 -0000 1.3 +++ t/net/perl/io/dir_config.pl 24 May 2003 10:04:29 -0000 @@ -1,6 +1,6 @@ #!perl use strict; -use Apache::test; +use Apache::testold; use Data::Dumper (); use Apache::ModuleConfig (); =20 Index: lib/Apache/test.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: lib/Apache/test.pm diff -N lib/Apache/test.pm --- lib/Apache/test.pm 24 Mar 2002 02:55:44 -0000 1.24 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,707 +0,0 @@ -package Apache::test; - -use strict; -use vars qw(@EXPORT $USE_THREAD $USE_SFIO $PERL_DIR @EXPORT_OK); -use Exporter (); -use Config; -use FileHandle (); -*import =3D \&Exporter::import; - -@EXPORT =3D qw(test fetch simple_fetch have_module skip_test - $USE_THREAD $USE_SFIO $PERL_DIR WIN32 grab run_test);=20 -@EXPORT_OK =3D qw(have_httpd); - -BEGIN {=20 - $ENV{PERL_LWP_USE_HTTP_10} =3D 1; #default to http/1.0 - - if(not $ENV{MOD_PERL}) { - eval { require "net/config.pl"; }; #for 'make test' - $PERL_DIR =3D $net::perldir; - }=20 - if ($net::httpserver) { - # Validate that the OS knows the name of the server in $net::httpserver = =20 - # if 'localhost' is not defined, the tests wouldn't pass - (my $hostname) =3D ($net::httpserver =3D~ /(.*?):/); - warn qq{\n*** [Crucial] You must define "$hostname" (e.g. in /etc/hosts) = in order for 'make test' to pass\n} =20 - unless gethostbyname $hostname; - } -} - -$PERL_DIR =3D $ENV{PERL_DIR} if exists $ENV{PERL_DIR}; - -$USE_THREAD =3D ($Config{extensions} =3D~ /Thread/) || $Config{usethreads}= ; -$USE_SFIO =3D (($Config{'usesfio'} || '') eq 'true'); - -my $Is_Win32 =3D ($^O eq "MSWin32"); -sub WIN32 () { $Is_Win32 }; - -my $UA; - -eval { - require LWP::UserAgent; - require URI::URL; - $UA =3D LWP::UserAgent->new; -}; - -unless (defined &Apache::bootstrap) { - *Apache::bootstrap =3D sub {}; - *Apache::Constants::bootstrap =3D sub {}; -} - -sub write_httpd_conf { - my $pkg =3D shift; - my %args =3D (conf_file =3D> 't/httpd.conf', @_); - my $DIR =3D `pwd`; chomp $DIR; - - local *CONF; - open CONF, ">$args{conf_file}" or die "Can't create $args{conf_file}: = $!"; - print CONF < - use lib "$DIR/blib/lib", "$DIR/t/lib"; - - -$args{include} -EOF - - return 1; -} - -sub _ask { - # Just a function for asking the user questions - my ($prompt, $default, $mustfind, $canskip) =3D @_; - - my $skip =3D defined $canskip ? " ('$canskip' to skip)" : ''; - my $response; - do { - print "$prompt [$default]$skip: "; - chomp($response =3D ); - $response ||=3D $default; - } until (!$mustfind || ($response eq $canskip) || (-e $response || !pr= int("$response not found\n"))); - - return $response; -} - -sub get_test_params { - my $pkg =3D shift; - - print("\nFor testing purposes, please give the full path to an httpd\n= ", - "with mod_perl enabled. The path defaults to \$ENV{APACHE}, if present= ."); - =20 - my %conf; - =20 - my $httpd =3D $ENV{'APACHE'} || which('apache') || which('httpd') || '= /usr/lib/httpd/httpd'; - - $httpd =3D _ask("\n", $httpd, 1, '!'); - if ($httpd eq '!') { - print "Skipping.\n"; - return; - } - system "$Config{lns} $httpd t/httpd"; - - # Default: search for dynamic dependencies if mod_so is present, don't= bother otherwise. - my $default =3D (`t/httpd -l` =3D~ /mod_so\.c/ ? 'y' : 'n'); - if (lc _ask("Search existing config file for dynamic module dependenci= es?", $default) eq 'y') { - my %compiled; - for (`t/httpd -V`) { - if (/([\w]+)=3D"(.*)"/) { - $compiled{$1} =3D $2; - } - } - $compiled{SERVER_CONFIG_FILE} =3D~ s,^,$compiled{HTTPD_ROOT}/, - unless $compiled{SERVER_CONFIG_FILE} =3D~ m,^/,; -=09 - my $file =3D _ask(" Config file", $compiled{SERVER_CONFIG_FILE}, 1); - $conf{modules} =3D $pkg->_read_existing_conf($file); - } - - # Get default user (apache doesn't like to run as root, special-case i= t) - my $defuser =3D ($< && getpwuid $<) || 'nobody'; - $conf{user} =3D _ask("User to run tests under", $defuser); - - my $defgroup =3D ($defuser eq 'nobody' ? 'nobody' : getgrgid((getpwnam= $conf{user})[3])); - $conf{group} =3D _ask("Group to run tests under", $defgroup); - - $conf{port} =3D _ask("Port to run tests under", 8228); - - return %conf; -} - -sub _read_existing_conf { - # Returns some "(Add|Load)Module" config lines, generated from the - # existing config file and a few must-have modules. - my ($self, $server_conf) =3D @_; - =20 - open SERVER_CONF, $server_conf or die "Couldn't open $server_conf: $!"= ; - my @lines =3D grep {!m/^\s*\#/} ; - close SERVER_CONF; - =20 - my @modules =3D grep /^\s*(Add|Load)Module/, @lines; - my ($server_root) =3D (map /^\s*ServerRoot\s*(\S+)/, @lines); - $server_root =3D~ s/^"//; - $server_root =3D~ s/"$//; - - # Rewrite all modules to load from an absolute path. - foreach (@modules) { - s!(\s)([^/\s]\S+/)!$1$server_root/$2!; - } - =20 - my $static_mods =3D $self->static_modules('t/httpd'); - =20 - my @load; - # Have to make sure that dir, autoindex and perl are loaded. - foreach my $module (qw(dir autoindex perl)) { - unless ($static_mods->{"mod_$module"} or grep /$module/i, @modules)= { - warn "Will attempt to load mod_$module dynamically.\n"; - push @load, $module; - } - } - =20 - # Directories where apache DSOs live. - my @module_dirs =3D map {m,(/\S*/),} @modules; - =20 - # Finally compute the directives to load modules that need to be loade= d. - MODULE: - foreach my $module (@load) { - foreach my $module_dir (@module_dirs) { - foreach my $filename ("mod_$module.so", "lib$module.so", "Apach= eModule\u$module.dll") { - if (-e "$module_dir/$filename") { - push @modules, "LoadModule ${module}_module $module_dir= /$filename\n"; next MODULE; - } - } - } - warn "Warning: couldn't find anything to load for 'mod_$module'.\n"= ; - } - =20 - print "Adding the following dynamic config lines: \n@modules"; - return join '', @modules; -} - -sub static_modules { - # Returns a hashref whose keys are each of the modules compiled - # statically into the given httpd binary. - my ($self, $httpd) =3D @_; - - my @l =3D `$httpd -l`; - return {map {lc($_) =3D> 1} map /(\S+)\.c/, @l}; -} - -# Find an executable in the PATH. -sub which { - foreach (map { "$_/$_[0]" } split /:/, $ENV{PATH}) { - next unless m,^/,; - return $_ if -x; - } -} - -sub test {=20 - shift() if UNIVERSAL::isa($_[0], __PACKAGE__); - my $s =3D $_[1] ? "ok $_[0]\n" : "not ok $_[0]\n"; - if($ENV{MOD_PERL}) { - Apache->request->print($s); - } - else { - print $s; - } -} - -sub fetch { - # Old code calls fetch() as a function, new code as a method - my $want_response; - $want_response =3D shift() if UNIVERSAL::isa($_[0], __PACKAGE__); - my ($ua, $url) =3D (@_ =3D=3D 1 ? ($UA, shift()) : @_); - my $request =3D ref $url ? $url : {uri=3D>$url}; - - # Set some defaults - $ENV{PORT} ||=3D 8529; # For mod_perl's own tests - $request->{method} ||=3D 'GET'; - $request->{content} =3D '' unless exists $request->{content}; - $request->{uri} =3D "http://localhost:$ENV{PORT}$request->{uri}" =20 - unless $request->{uri} =3D~ /^http/; - $request->{headers}{Content_Type} =3D 'application/x-www-form-urlencod= ed' - if (!$request->{headers} and $request->{method} eq 'POST'); # Is this ne= cessary? - - # Create & send the request - $request->{headers} =3D new HTTP::Headers(%{$request->{headers}||{}}); - my $req =3D new HTTP::Request(@{$request}{'method','uri','headers','co= ntent'}); - my $response =3D $ua->request($req); - - return $want_response ? $response : $response->content; -} - -sub simple_fetch { - my $ua =3D LWP::UserAgent->new; - my $url =3D URI::URL->new("http://$net::httpserver"); - my($path,$q) =3D split /\?/, shift;=20 - $url->path($path); - $url->query($q) if $q; - my $request =3D new HTTP::Request('GET', $url); - my $response =3D $ua->request($request, undef, undef); =20 - $response->is_success; -} - -#even if eval $mod fails, the .pm ends up in %INC -#so the next eval $mod succeeds, when it shouldnot - -my %really_have =3D ( - 'Apache::Table' =3D> sub {=20 - if ($ENV{MOD_PERL}) { - return Apache::Table->can('TIEHASH'); - } - else { - return $net::callback_hooks{PERL_TABLE_API}; - } - }, -); - -for (qw(Apache::Cookie Apache::Request)) { - $really_have{$_} =3D $really_have{'Apache::Table'}; -} - -sub have_module { - my $mod =3D shift; - my $v =3D shift; - eval {# surpress "can't boostrap" warnings - local $SIG{__WARN__} =3D sub {}; - require Apache; - require Apache::Constants; - }; - - eval "require $mod"; - if($v and not $@) { - eval {=20 - local $SIG{__WARN__} =3D sub {}; - $mod->UNIVERSAL::VERSION($v); - }; - if($@) { - warn $@; - return 0; - } - } - if($@ && ($@ =3D~ /Can.t locate/)) { - return 0; - } - elsif($@ && ($@ =3D~ /Can.t find loadable object for module/)) { - return 0; - } - elsif($@) { - warn "$@\n"; - } - - if (my $cv =3D $really_have{$mod}) { - return 0 unless $cv->(); - } - - print "module $mod is installed\n" unless $ENV{MOD_PERL}; - =20 - return 1; -} - -sub skip_test { - print "1..0\n"; - exit; -} - -sub have_httpd { - return -e 't/httpd'; -} - -sub run { - require Test::Harness; - my $self =3D shift; - my $args =3D shift || {}; - my @tests =3D (); - - # First we check if we already are within the "t" directory - if (-d "t") { - # try to move into test directory - chdir "t" or die "Can't chdir: $!"; - - # fix all relative library locations - foreach (@INC) { - $_ =3D "../$_" unless m,^(/)|([a-f]:),i; - } - } - - # Pick up the library files from the ../blib directory - unshift(@INC, "../blib/lib", "../blib/arch"); - #print "@INC\n"; - - $Test::Harness::verbose =3D shift(@ARGV) - if $ARGV[0] =3D~ /^\d+$/ || $ARGV[0] eq "-v"; - - $Test::Harness::verbose ||=3D $args->{verbose}; - - if (@ARGV) { - for (@ARGV) { - if (-d $_) { - push(@tests, <$_/*.t>); - }=20 - else { - $_ .=3D ".t" unless /\.t$/; - push(@tests, $_); - } - } - }=20 - else { - push @tests, <*.t>, map { <$_/*.t> } @{ $args->{tdirs} || [] }; - } - - Test::Harness::runtests(@tests); -} - -sub MM_test { - # Writes the test section for the Makefile - shift(); # Don't need package name - my %conf =3D @_; - - my $section =3D < 0) {=20 - die "usage: grab host:port path"; - } - - my($host, $port) =3D split ":", shift @args; - $port ||=3D 80; - my $url =3D shift @args || "/"; - - my $remote =3D IO::Socket::INET->new(Proto =3D> "tcp", - PeerAddr =3D> $host, - PeerPort =3D> $port, - ); - unless ($remote) { - die "cannot connect to http daemon on $host";=20 - } - $remote->autoflush(1); - print $remote "GET $url HTTP/1.0\n\n"; - my $response_line =3D 0; - my $header_terminator =3D 0; - my @msg =3D (); - - while ( <$remote> ) { - #e.g. HTTP/1.1 200 OK - if(m:^(HTTP/\d+\.\d+)[ \t]+(\d+)[ \t]*([^\012]*):i) { - push @msg, $_; - $response_line =3D 1; - } - elsif(/^([a-zA-Z0-9_\-]+)\s*:\s*(.*)/) { - push @msg, $_; - } - elsif(/^\015?\012$/) { - $header_terminator =3D 1; - push @msg, $_; - } - - print; - } - close $remote; - - print "~" x 40, "\n", "Diagnostics:\n"; - if ($response_line and $header_terminator) { - print " HTTP response is valid:\n"; - } - else { - print " GET -> http://$host:$port$url\n"; - print " >>> No response line\n" unless $response_line; - print " >>> No header terminator\n" unless $header_terminator; - print " *** HTTP response is malformed\n"; - } - print "-" x 40, "\n", @msg, "-" x 40, "\n"; -} - -sub run_test { - my($test, $verbose) =3D @_;=20 - my $cmd =3D "$^X -w $test|"; - my $fh =3D FileHandle->new; - $fh->open($cmd) or print "can't run $test. $!\n"; - my($ok,$next,$max,$files,$totok,$totmax); - $ok =3D $next =3D $max =3D 0; - my @failed =3D (); - while (<$fh>) { - if( $verbose ){ - print ">>> $_"; - } - if (/^1\.\.([0-9]+)/) { - $max =3D $1; - $totmax +=3D $max; - $files++; - $next =3D 1; - } - elsif ($max && /^(not\s+)?ok\b/) { - my $this =3D $next; - if (/^not ok\s*(\d*)/){ - $this =3D $1 if $1 > 0; - push @failed, $this; - } - elsif (/^ok\s*(\d*)/) { - $this =3D $1 if $1 > 0; - $ok++; - $totok++; - } - if ($this > $next) { - # warn "Test output counter mismatch [test $this]\n"; - # no need to warn probably - push @failed, $next..$this-1; - } - elsif ($this < $next) { - #we have seen more "ok" lines than the number suggests - warn "Confused test output: test $this answered after test ", $next-1, "= \n"; - $next =3D $this; - } - $next =3D $this + 1; - } - } - $fh->close; # must close to reap child resource values - return($max, \@failed); -} - -1; - -__END__ - -=3Dhead1 NAME - -Apache::test - Facilitates testing of Apache::* modules - -=3Dhead1 SYNOPSIS - - # In Makefile.PL - use Apache::test; - my %params =3D Apache::test->get_test_params(); - Apache::test->write_httpd_conf(%params, include =3D> $more_directives); - *MY::test =3D sub { Apache::test->MM_test(%params) }; - - # In t/*.t script (or test.pl) - use Apache::test qw(skip_test have_httpd); - skip_test unless have_httpd; - (Some more methods of Doug's that I haven't reviewed or documented yet) - -=3Dhead1 DESCRIPTION - -This module helps authors of Apache::* modules write test suites that -can query an actual running Apache server with mod_perl and their -modules loaded into it. Its functionality is generally separated into -methods that go in a Makefile.PL to configure, start, and stop the -server, and methods that go in one of the test scripts to make HTTP -queries and manage the results. - -=3Dhead1 METHODS - -=3Dhead2 get_test_params() - -This will ask the user a few questions about where the httpd binary -is, and what user/group/port should be used when running the server. -It will return a hash of the information it discovers. This hash is -suitable for passing to the C method. - -=3Dhead2 write_httpd_conf(%params) - -This will write a basic C file suitable for starting a -HTTP server during the 'make test' stage. A hash of key/value pairs -that affect the written file can be passed as arguments. The -following keys are recognized: - -=3Dover 4 - -=3Ditem * conf_file - -The path to the file that will be created. Default is 't/httpd.conf'. - -=3Ditem * port - -The port that the Apache server will listen on. - -=3Ditem * user - -The user that the Apache server will run as. - -=3Ditem * group - -The group that the Apache server will run as. - -=3Ditem * include - -Any additional text you want added at the end of the config file. -Typically you'll have some C and C -directives to pass control to the module you're testing. The C -directories will be added to the C<@INC> path when searching for -modules, so that's nice. - -=3Dback - -=3Dhead2 MM_test(%params) - -This method helps write a Makefile that supports running a web server -during the 'make test' stage. When you execute 'make test', 'make' -will run 'make start_httpd', 'make run_tests', and 'make kill_httpd' -in sequence. You can also run these commands independently if you -want. - -Pass the hash of parameters returned by C as an -argument to C. - -To patch into the ExtUtils::MakeMaker wizardry (voodoo?), typically -you'll do the following in your Makefile.PL: - - *MY::test =3D sub { Apache::test->MM_test(%params) }; - -=3Dhead2 fetch - - Apache::test->fetch($request); - Apache::test->fetch($user_agent, $request); - -Call this method in a test script in order to fetch a page from the -running web server. If you pass two arguments, the first should be an -LWP::UserAgent object, and the second should specify the request to -make of the server. If you only pass one argument, it specifies the -request to make. - -The request can be specified either by a simple string indicating the -URI to fetch, or by a hash reference, which gives you more control -over the request. The following keys are recognized in the hash: - -=3Dover 4 - -=3Ditem * uri - -The URI to fetch from the server. If the URI does not begin with -"http", we prepend "http://localhost:$PORT" so that we make requests -of the test server. - -=3Ditem * method - -The request method to use. Default is 'GET'. - -=3Ditem * content - -The request content body. Typically used to simulate HTML fill-out -form submission for POST requests. Default is null. - -=3Ditem * headers - -A hash of headers you want sent with the request. You might use this -to send cookies or provide some application-specific header. - -=3Dback - -If you don't provide a 'headers' parameter and you set the 'method' -to 'POST', then we assume that you're trying to simulate HTML form -submission and we add a 'Content_Type' header with a value of -'application/x-www-form-urlencoded'. - -In a scalar context, fetch() returns the content of the web server's -response. In a list context, fetch() returns the content and the -HTTP::Response object itself. This can be handy if you need to check -the response headers, or the HTTP return code, or whatever. - -=3Dhead2 static_modules - - Example: $mods =3D Apache::test->static_modules('/path/to/httpd'); - -This method returns a hashref whose keys are all the modules -statically compiled into the given httpd binary. The corresponding -values are all 1. - -=3Dhead1 EXAMPLES - -No good examples yet. Example submissions are welcome. In the meantime, = see -L , which -I'm retrofitting to use Apache::test. - -=3Dhead1 TO DO - -The MM_test method doesn't try to be very smart, it just writes the -text that seems to work in my configuration. I am morally against -using the 'make' command for installing Perl modules (though of course -I do it anyway), so I haven't looked into this very much. Send bug -reports or better (patches). - -I've got lots of code in my Apache::AuthCookie module (etc.) that -assists in actually making the queries of the running server. I plan -to add that to this module, but first I need to compare what's already -here that does the same stuff. - -=3Dhead1 KUDOS - -To Doug MacEachern for writing the first version of this module. - -To caelum@debian.org (Rafael Kitover) for contributing the code to -parse existing httpd.conf files for --enable-shared=3Dmax and DSOs. - -=3Dhead1 CAVEATS - -Except for making sure that the mod_perl distribution itself can run -'make test' okay, I haven't tried very hard to keep compatibility with -older versions of this module. In particular MM_test() has changed -and probably isn't usable in the old ways, since some of its -assumptions are gone. But none of this was ever documented, and -MM_test() doesn't seem to actually be used anywhere in the mod_perl -disribution, so I don't feel so bad about it. - -=3Dhead1 AUTHOR - -Doug MacEachern (original version) - -Ken Williams (latest changes and this documentation) - -=3Dcut - Index: lib/Apache/testold.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: lib/Apache/testold.pm diff -N lib/Apache/testold.pm --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/Apache/testold.pm 24 May 2003 10:04:28 -0000 @@ -0,0 +1,709 @@ +package Apache::testold; + +use strict; +use vars qw(@EXPORT $USE_THREAD $USE_SFIO $PERL_DIR @EXPORT_OK $VERSION); +use Exporter (); +use Config; +use FileHandle (); +*import =3D \&Exporter::import; + +$VERSION =3D "0.01"; + +@EXPORT =3D qw(test fetch simple_fetch have_module skip_test + $USE_THREAD $USE_SFIO $PERL_DIR WIN32 grab run_test);=20 +@EXPORT_OK =3D qw(have_httpd); + +BEGIN {=20 + $ENV{PERL_LWP_USE_HTTP_10} =3D 1; #default to http/1.0 + + if(not $ENV{MOD_PERL}) { + eval { require "net/config.pl"; }; #for 'make test' + $PERL_DIR =3D $net::perldir; + }=20 + if ($net::httpserver) { + # Validate that the OS knows the name of the server in $net::httpserver = =20 + # if 'localhost' is not defined, the tests wouldn't pass + (my $hostname) =3D ($net::httpserver =3D~ /(.*?):/); + warn qq{\n*** [Crucial] You must define "$hostname" (e.g. in /etc/hosts) = in order for 'make test' to pass\n} =20 + unless gethostbyname $hostname; + } +} + +$PERL_DIR =3D $ENV{PERL_DIR} if exists $ENV{PERL_DIR}; + +$USE_THREAD =3D ($Config{extensions} =3D~ /Thread/) || $Config{usethreads}= ; +$USE_SFIO =3D (($Config{'usesfio'} || '') eq 'true'); + +my $Is_Win32 =3D ($^O eq "MSWin32"); +sub WIN32 () { $Is_Win32 }; + +my $UA; + +eval { + require LWP::UserAgent; + require URI::URL; + $UA =3D LWP::UserAgent->new; +}; + +unless (defined &Apache::bootstrap) { + *Apache::bootstrap =3D sub {}; + *Apache::Constants::bootstrap =3D sub {}; +} + +sub write_httpd_conf { + my $pkg =3D shift; + my %args =3D (conf_file =3D> 't/httpd.conf', @_); + my $DIR =3D `pwd`; chomp $DIR; + + local *CONF; + open CONF, ">$args{conf_file}" or die "Can't create $args{conf_file}: = $!"; + print CONF < + use lib "$DIR/blib/lib", "$DIR/t/lib"; + + +$args{include} +EOF + + return 1; +} + +sub _ask { + # Just a function for asking the user questions + my ($prompt, $default, $mustfind, $canskip) =3D @_; + + my $skip =3D defined $canskip ? " ('$canskip' to skip)" : ''; + my $response; + do { + print "$prompt [$default]$skip: "; + chomp($response =3D ); + $response ||=3D $default; + } until (!$mustfind || ($response eq $canskip) || (-e $response || !pr= int("$response not found\n"))); + + return $response; +} + +sub get_test_params { + my $pkg =3D shift; + + print("\nFor testing purposes, please give the full path to an httpd\n= ", + "with mod_perl enabled. The path defaults to \$ENV{APACHE}, if present= ."); + =20 + my %conf; + =20 + my $httpd =3D $ENV{'APACHE'} || which('apache') || which('httpd') || '= /usr/lib/httpd/httpd'; + + $httpd =3D _ask("\n", $httpd, 1, '!'); + if ($httpd eq '!') { + print "Skipping.\n"; + return; + } + system "$Config{lns} $httpd t/httpd"; + + # Default: search for dynamic dependencies if mod_so is present, don't= bother otherwise. + my $default =3D (`t/httpd -l` =3D~ /mod_so\.c/ ? 'y' : 'n'); + if (lc _ask("Search existing config file for dynamic module dependenci= es?", $default) eq 'y') { + my %compiled; + for (`t/httpd -V`) { + if (/([\w]+)=3D"(.*)"/) { + $compiled{$1} =3D $2; + } + } + $compiled{SERVER_CONFIG_FILE} =3D~ s,^,$compiled{HTTPD_ROOT}/, + unless $compiled{SERVER_CONFIG_FILE} =3D~ m,^/,; +=09 + my $file =3D _ask(" Config file", $compiled{SERVER_CONFIG_FILE}, 1); + $conf{modules} =3D $pkg->_read_existing_conf($file); + } + + # Get default user (apache doesn't like to run as root, special-case i= t) + my $defuser =3D ($< && getpwuid $<) || 'nobody'; + $conf{user} =3D _ask("User to run tests under", $defuser); + + my $defgroup =3D ($defuser eq 'nobody' ? 'nobody' : getgrgid((getpwnam= $conf{user})[3])); + $conf{group} =3D _ask("Group to run tests under", $defgroup); + + $conf{port} =3D _ask("Port to run tests under", 8228); + + return %conf; +} + +sub _read_existing_conf { + # Returns some "(Add|Load)Module" config lines, generated from the + # existing config file and a few must-have modules. + my ($self, $server_conf) =3D @_; + =20 + open SERVER_CONF, $server_conf or die "Couldn't open $server_conf: $!"= ; + my @lines =3D grep {!m/^\s*\#/} ; + close SERVER_CONF; + =20 + my @modules =3D grep /^\s*(Add|Load)Module/, @lines; + my ($server_root) =3D (map /^\s*ServerRoot\s*(\S+)/, @lines); + $server_root =3D~ s/^"//; + $server_root =3D~ s/"$//; + + # Rewrite all modules to load from an absolute path. + foreach (@modules) { + s!(\s)([^/\s]\S+/)!$1$server_root/$2!; + } + =20 + my $static_mods =3D $self->static_modules('t/httpd'); + =20 + my @load; + # Have to make sure that dir, autoindex and perl are loaded. + foreach my $module (qw(dir autoindex perl)) { + unless ($static_mods->{"mod_$module"} or grep /$module/i, @modules)= { + warn "Will attempt to load mod_$module dynamically.\n"; + push @load, $module; + } + } + =20 + # Directories where apache DSOs live. + my @module_dirs =3D map {m,(/\S*/),} @modules; + =20 + # Finally compute the directives to load modules that need to be loade= d. + MODULE: + foreach my $module (@load) { + foreach my $module_dir (@module_dirs) { + foreach my $filename ("mod_$module.so", "lib$module.so", "Apach= eModule\u$module.dll") { + if (-e "$module_dir/$filename") { + push @modules, "LoadModule ${module}_module $module_dir= /$filename\n"; next MODULE; + } + } + } + warn "Warning: couldn't find anything to load for 'mod_$module'.\n"= ; + } + =20 + print "Adding the following dynamic config lines: \n@modules"; + return join '', @modules; +} + +sub static_modules { + # Returns a hashref whose keys are each of the modules compiled + # statically into the given httpd binary. + my ($self, $httpd) =3D @_; + + my @l =3D `$httpd -l`; + return {map {lc($_) =3D> 1} map /(\S+)\.c/, @l}; +} + +# Find an executable in the PATH. +sub which { + foreach (map { "$_/$_[0]" } split /:/, $ENV{PATH}) { + next unless m,^/,; + return $_ if -x; + } +} + +sub test {=20 + shift() if UNIVERSAL::isa($_[0], __PACKAGE__); + my $s =3D $_[1] ? "ok $_[0]\n" : "not ok $_[0]\n"; + if($ENV{MOD_PERL}) { + Apache->request->print($s); + } + else { + print $s; + } +} + +sub fetch { + # Old code calls fetch() as a function, new code as a method + my $want_response; + $want_response =3D shift() if UNIVERSAL::isa($_[0], __PACKAGE__); + my ($ua, $url) =3D (@_ =3D=3D 1 ? ($UA, shift()) : @_); + my $request =3D ref $url ? $url : {uri=3D>$url}; + + # Set some defaults + $ENV{PORT} ||=3D 8529; # For mod_perl's own tests + $request->{method} ||=3D 'GET'; + $request->{content} =3D '' unless exists $request->{content}; + $request->{uri} =3D "http://localhost:$ENV{PORT}$request->{uri}" =20 + unless $request->{uri} =3D~ /^http/; + $request->{headers}{Content_Type} =3D 'application/x-www-form-urlencod= ed' + if (!$request->{headers} and $request->{method} eq 'POST'); # Is this ne= cessary? + + # Create & send the request + $request->{headers} =3D new HTTP::Headers(%{$request->{headers}||{}}); + my $req =3D new HTTP::Request(@{$request}{'method','uri','headers','co= ntent'}); + my $response =3D $ua->request($req); + + return $want_response ? $response : $response->content; +} + +sub simple_fetch { + my $ua =3D LWP::UserAgent->new; + my $url =3D URI::URL->new("http://$net::httpserver"); + my($path,$q) =3D split /\?/, shift;=20 + $url->path($path); + $url->query($q) if $q; + my $request =3D new HTTP::Request('GET', $url); + my $response =3D $ua->request($request, undef, undef); =20 + $response->is_success; +} + +#even if eval $mod fails, the .pm ends up in %INC +#so the next eval $mod succeeds, when it shouldnot + +my %really_have =3D ( + 'Apache::Table' =3D> sub {=20 + if ($ENV{MOD_PERL}) { + return Apache::Table->can('TIEHASH'); + } + else { + return $net::callback_hooks{PERL_TABLE_API}; + } + }, +); + +for (qw(Apache::Cookie Apache::Request)) { + $really_have{$_} =3D $really_have{'Apache::Table'}; +} + +sub have_module { + my $mod =3D shift; + my $v =3D shift; + eval {# surpress "can't boostrap" warnings + local $SIG{__WARN__} =3D sub {}; + require Apache; + require Apache::Constants; + }; + + eval "require $mod"; + if($v and not $@) { + eval {=20 + local $SIG{__WARN__} =3D sub {}; + $mod->UNIVERSAL::VERSION($v); + }; + if($@) { + warn $@; + return 0; + } + } + if($@ && ($@ =3D~ /Can.t locate/)) { + return 0; + } + elsif($@ && ($@ =3D~ /Can.t find loadable object for module/)) { + return 0; + } + elsif($@) { + warn "$@\n"; + } + + if (my $cv =3D $really_have{$mod}) { + return 0 unless $cv->(); + } + + print "module $mod is installed\n" unless $ENV{MOD_PERL}; + =20 + return 1; +} + +sub skip_test { + print "1..0\n"; + exit; +} + +sub have_httpd { + return -e 't/httpd'; +} + +sub run { + require Test::Harness; + my $self =3D shift; + my $args =3D shift || {}; + my @tests =3D (); + + # First we check if we already are within the "t" directory + if (-d "t") { + # try to move into test directory + chdir "t" or die "Can't chdir: $!"; + + # fix all relative library locations + foreach (@INC) { + $_ =3D "../$_" unless m,^(/)|([a-f]:),i; + } + } + + # Pick up the library files from the ../blib directory + unshift(@INC, "../blib/lib", "../blib/arch"); + #print "@INC\n"; + + $Test::Harness::verbose =3D shift(@ARGV) + if $ARGV[0] =3D~ /^\d+$/ || $ARGV[0] eq "-v"; + + $Test::Harness::verbose ||=3D $args->{verbose}; + + if (@ARGV) { + for (@ARGV) { + if (-d $_) { + push(@tests, <$_/*.t>); + }=20 + else { + $_ .=3D ".t" unless /\.t$/; + push(@tests, $_); + } + } + }=20 + else { + push @tests, <*.t>, map { <$_/*.t> } @{ $args->{tdirs} || [] }; + } + + Test::Harness::runtests(@tests); +} + +sub MM_test { + # Writes the test section for the Makefile + shift(); # Don't need package name + my %conf =3D @_; + + my $section =3D < 0) {=20 + die "usage: grab host:port path"; + } + + my($host, $port) =3D split ":", shift @args; + $port ||=3D 80; + my $url =3D shift @args || "/"; + + my $remote =3D IO::Socket::INET->new(Proto =3D> "tcp", + PeerAddr =3D> $host, + PeerPort =3D> $port, + ); + unless ($remote) { + die "cannot connect to http daemon on $host";=20 + } + $remote->autoflush(1); + print $remote "GET $url HTTP/1.0\n\n"; + my $response_line =3D 0; + my $header_terminator =3D 0; + my @msg =3D (); + + while ( <$remote> ) { + #e.g. HTTP/1.1 200 OK + if(m:^(HTTP/\d+\.\d+)[ \t]+(\d+)[ \t]*([^\012]*):i) { + push @msg, $_; + $response_line =3D 1; + } + elsif(/^([a-zA-Z0-9_\-]+)\s*:\s*(.*)/) { + push @msg, $_; + } + elsif(/^\015?\012$/) { + $header_terminator =3D 1; + push @msg, $_; + } + + print; + } + close $remote; + + print "~" x 40, "\n", "Diagnostics:\n"; + if ($response_line and $header_terminator) { + print " HTTP response is valid:\n"; + } + else { + print " GET -> http://$host:$port$url\n"; + print " >>> No response line\n" unless $response_line; + print " >>> No header terminator\n" unless $header_terminator; + print " *** HTTP response is malformed\n"; + } + print "-" x 40, "\n", @msg, "-" x 40, "\n"; +} + +sub run_test { + my($test, $verbose) =3D @_;=20 + my $cmd =3D "$^X -w $test|"; + my $fh =3D FileHandle->new; + $fh->open($cmd) or print "can't run $test. $!\n"; + my($ok,$next,$max,$files,$totok,$totmax); + $ok =3D $next =3D $max =3D 0; + my @failed =3D (); + while (<$fh>) { + if( $verbose ){ + print ">>> $_"; + } + if (/^1\.\.([0-9]+)/) { + $max =3D $1; + $totmax +=3D $max; + $files++; + $next =3D 1; + } + elsif ($max && /^(not\s+)?ok\b/) { + my $this =3D $next; + if (/^not ok\s*(\d*)/){ + $this =3D $1 if $1 > 0; + push @failed, $this; + } + elsif (/^ok\s*(\d*)/) { + $this =3D $1 if $1 > 0; + $ok++; + $totok++; + } + if ($this > $next) { + # warn "Test output counter mismatch [test $this]\n"; + # no need to warn probably + push @failed, $next..$this-1; + } + elsif ($this < $next) { + #we have seen more "ok" lines than the number suggests + warn "Confused test output: test $this answered after test ", $next-1, "= \n"; + $next =3D $this; + } + $next =3D $this + 1; + } + } + $fh->close; # must close to reap child resource values + return($max, \@failed); +} + +1; + +__END__ + +=3Dhead1 NAME + +Apache::testold - Facilitates testing of Apache::* modules + +=3Dhead1 SYNOPSIS + + # In Makefile.PL + use Apache::testold; + my %params =3D Apache::testold->get_test_params(); + Apache::testold->write_httpd_conf(%params, include =3D> $more_directives)= ; + *MY::test =3D sub { Apache::testold->MM_test(%params) }; + + # In t/*.t script (or test.pl) + use Apache::testold qw(skip_test have_httpd); + skip_test unless have_httpd; + (Some more methods of Doug's that I haven't reviewed or documented yet) + +=3Dhead1 DESCRIPTION + +This module helps authors of Apache::* modules write test suites that +can query an actual running Apache server with mod_perl and their +modules loaded into it. Its functionality is generally separated into +methods that go in a Makefile.PL to configure, start, and stop the +server, and methods that go in one of the test scripts to make HTTP +queries and manage the results. + +=3Dhead1 METHODS + +=3Dhead2 get_test_params() + +This will ask the user a few questions about where the httpd binary +is, and what user/group/port should be used when running the server. +It will return a hash of the information it discovers. This hash is +suitable for passing to the C method. + +=3Dhead2 write_httpd_conf(%params) + +This will write a basic C file suitable for starting a +HTTP server during the 'make test' stage. A hash of key/value pairs +that affect the written file can be passed as arguments. The +following keys are recognized: + +=3Dover 4 + +=3Ditem * conf_file + +The path to the file that will be created. Default is 't/httpd.conf'. + +=3Ditem * port + +The port that the Apache server will listen on. + +=3Ditem * user + +The user that the Apache server will run as. + +=3Ditem * group + +The group that the Apache server will run as. + +=3Ditem * include + +Any additional text you want added at the end of the config file. +Typically you'll have some C and C +directives to pass control to the module you're testing. The C +directories will be added to the C<@INC> path when searching for +modules, so that's nice. + +=3Dback + +=3Dhead2 MM_test(%params) + +This method helps write a Makefile that supports running a web server +during the 'make test' stage. When you execute 'make test', 'make' +will run 'make start_httpd', 'make run_tests', and 'make kill_httpd' +in sequence. You can also run these commands independently if you +want. + +Pass the hash of parameters returned by C as an +argument to C. + +To patch into the ExtUtils::MakeMaker wizardry (voodoo?), typically +you'll do the following in your Makefile.PL: + + *MY::test =3D sub { Apache::testold->MM_test(%params) }; + +=3Dhead2 fetch + + Apache::testold->fetch($request); + Apache::testold->fetch($user_agent, $request); + +Call this method in a test script in order to fetch a page from the +running web server. If you pass two arguments, the first should be an +LWP::UserAgent object, and the second should specify the request to +make of the server. If you only pass one argument, it specifies the +request to make. + +The request can be specified either by a simple string indicating the +URI to fetch, or by a hash reference, which gives you more control +over the request. The following keys are recognized in the hash: + +=3Dover 4 + +=3Ditem * uri + +The URI to fetch from the server. If the URI does not begin with +"http", we prepend "http://localhost:$PORT" so that we make requests +of the test server. + +=3Ditem * method + +The request method to use. Default is 'GET'. + +=3Ditem * content + +The request content body. Typically used to simulate HTML fill-out +form submission for POST requests. Default is null. + +=3Ditem * headers + +A hash of headers you want sent with the request. You might use this +to send cookies or provide some application-specific header. + +=3Dback + +If you don't provide a 'headers' parameter and you set the 'method' +to 'POST', then we assume that you're trying to simulate HTML form +submission and we add a 'Content_Type' header with a value of +'application/x-www-form-urlencoded'. + +In a scalar context, fetch() returns the content of the web server's +response. In a list context, fetch() returns the content and the +HTTP::Response object itself. This can be handy if you need to check +the response headers, or the HTTP return code, or whatever. + +=3Dhead2 static_modules + + Example: $mods =3D Apache::testold->static_modules('/path/to/httpd'); + +This method returns a hashref whose keys are all the modules +statically compiled into the given httpd binary. The corresponding +values are all 1. + +=3Dhead1 EXAMPLES + +No good examples yet. Example submissions are welcome. In the meantime, = see +L , which +I'm retrofitting to use Apache::testold. + +=3Dhead1 TO DO + +The MM_test method doesn't try to be very smart, it just writes the +text that seems to work in my configuration. I am morally against +using the 'make' command for installing Perl modules (though of course +I do it anyway), so I haven't looked into this very much. Send bug +reports or better (patches). + +I've got lots of code in my Apache::AuthCookie module (etc.) that +assists in actually making the queries of the running server. I plan +to add that to this module, but first I need to compare what's already +here that does the same stuff. + +=3Dhead1 KUDOS + +To Doug MacEachern for writing the first version of this module. + +To caelum@debian.org (Rafael Kitover) for contributing the code to +parse existing httpd.conf files for --enable-shared=3Dmax and DSOs. + +=3Dhead1 CAVEATS + +Except for making sure that the mod_perl distribution itself can run +'make test' okay, I haven't tried very hard to keep compatibility with +older versions of this module. In particular MM_test() has changed +and probably isn't usable in the old ways, since some of its +assumptions are gone. But none of this was ever documented, and +MM_test() doesn't seem to actually be used anywhere in the mod_perl +disribution, so I don't feel so bad about it. + +=3Dhead1 AUTHOR + +Doug MacEachern (original version) + +Ken Williams (latest changes and this documentation) + +=3Dcut + > __________________________________________________________________ > Stas Bekman JAm_pH ------> Just Another mod_perl Hacker > http://stason.org/ mod_perl Guide ---> http://perl.apache.org > mailto:stas@stason.org http://use.perl.org http://apacheweek.com > http://modperlbook.org http://apache.org http://ticketmaster.com >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org > For additional commands, e-mail: dev-help@perl.apache.org --=20 -- ------------------------------------------------------------------------= ----- Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634= E37B) http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3= A5A5 Q: It is impossible to make anything foolproof because fools are so ingenio= us. perl -e'$$=3D\${gozer};{$_=3Dunpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$+= +&&redo}' --=-y9hxjHXVBQOMF1qr64Dg Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+z0SdyzKhB4jDpaURAqXtAKCd3ZAmp8Fd2OpV7VwwhqYJZC4pLACZAVdu SVx5jAEYEBIqFBDapCPiiA0= =AEax -----END PGP SIGNATURE----- --=-y9hxjHXVBQOMF1qr64Dg--