From modperl-cvs-return-2141-apmail-modperl-cvs-archive=apache.org@apache.org Fri Jan 18 06:52:02 2002 Return-Path: Delivered-To: apmail-modperl-cvs-archive@apache.org Received: (qmail 1237 invoked by uid 500); 18 Jan 2002 06:52:02 -0000 Mailing-List: contact modperl-cvs-help@apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@apache.org Received: (qmail 1226 invoked by uid 500); 18 Jan 2002 06:52:02 -0000 Delivered-To: apmail-modperl-2.0-cvs@apache.org Date: 18 Jan 2002 06:52:01 -0000 Message-ID: <20020118065201.80658.qmail@icarus.apache.org> From: stas@apache.org To: modperl-2.0-cvs@apache.org Subject: cvs commit: modperl-2.0/t/response/TestDirective perlmodule.pm X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stas 02/01/17 22:52:01 Added: t/directive perlmodule.t t/response/TestDirective perlmodule.pm Log: - add a test to test handling of PerlModule/Require directives for vhosts which inherit the interpretor from the parent. this time use the PerlModule directive for testing. Revision Changes Path 1.1 modperl-2.0/t/directive/perlmodule.t Index: perlmodule.t =================================================================== # this test tests PerlRequire configuration directive ######################################################################## use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; use Apache::TestRequest; my $module = 'TestDirective::perlmodule'; plan tests => 1; Apache::TestRequest::module($module); my $config = Apache::Test::config(); my $hostport = Apache::TestRequest::hostport($config); t_debug("connecting to $hostport"); ok t_cmp($module, GET_BODY("/TestDirective::perlmodule"), "testing PerlModule in $module"); 1.1 modperl-2.0/t/response/TestDirective/perlmodule.pm Index: perlmodule.pm =================================================================== package TestDirective::perlmodule; # This test is similar to TestDirective::perlrequire. Here we test # whether vhost inheriting the parent perl from the base can handle # PerlModule directives. use strict; use warnings FATAL => 'all'; use Apache::Test (); use Apache::Const -compile => 'OK'; use File::Spec::Functions qw(catfile); sub handler { my $r = shift; $r->content_type('text/plain'); $r->puts($ApacheTest::PerlModuleTest::MAGIC || ''); Apache::OK; } sub APACHE_TEST_CONFIGURE { my ($class, $self) = @_; my $vars = $self->{vars}; my $target_dir = catfile $vars->{documentroot}, 'testdirective'; my $magic = __PACKAGE__; my $content = <writefile($file, $content, 1); } 1; __END__ PerlSwitches -Mlib=@documentroot@/testdirective/perlmodule-vh PerlModule ApacheTest::PerlModuleTest SetHandler modperl PerlResponseHandler TestDirective::perlmodule