Author: stas Date: Tue May 24 11:38:46 2005 New Revision: 178236 URL: http://svn.apache.org/viewcvs?rev=178236&view=rev Log: make the configuration enabled if mod_mime and mod_alias are available
Modified: perl/modperl/trunk/t/conf/extra.conf.in perl/modperl/trunk/t/conf/extra.last.conf.in perl/modperl/trunk/t/directive/perl.t perl/modperl/trunk/t/filter/TestFilter/out_str_lc.pm perl/modperl/trunk/t/filter/TestFilter/out_str_subreq_default.pm perl/modperl/trunk/t/filter/out_str_lc.t perl/modperl/trunk/t/filter/out_str_subreq_default.t perl/modperl/trunk/t/modules/include.t perl/modperl/trunk/t/modules/include2.t perl/modperl/trunk/t/response/TestAPI/request_rec.pm perl/modperl/trunk/t/response/TestAPI/slurp_filename.pm Modified: perl/modperl/trunk/t/conf/extra.conf.in URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/conf/extra.conf.in?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/conf/extra.conf.in (original) +++ perl/modperl/trunk/t/conf/extra.conf.in Tue May 24 11:38:46 2005 @@ -39,7 +39,9 @@ #for t/modules/include.t <Directory @ServerRoot@/htdocs/includes> - AddOutputFilter INCLUDES .shtml + <IfModule mod_mime.c> + AddOutputFilter INCLUDES .shtml + </IfModule> # #virtual include of a script that sets content type is # considered the same as #cmd by mod_include, # therefore can't use IncludesNOEXEC here @@ -51,7 +53,9 @@ Options +ExecCGI +IncludesNoExec PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders +GlobalRequest - AddOutputFilter INCLUDES .spl + <IfModule mod_mime.c> + AddOutputFilter INCLUDES .spl + </IfModule> </Directory> <IfModule mod_perl.c> Modified: perl/modperl/trunk/t/conf/extra.last.conf.in URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/conf/extra.last.conf.in?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/conf/extra.last.conf.in (original) +++ perl/modperl/trunk/t/conf/extra.last.conf.in Tue May 24 11:38:46 2005 @@ -4,13 +4,16 @@ ### --------------------------------- ### <Perl > -push @Alias, ['/perl_sections', '@DocumentRoot@']; -$Location{'/perl_sections'} = { - 'PerlInitHandler' => 'ModPerl::Test::add_config', - 'AuthType' => 'Basic', - 'AuthName' => 'PerlSection', - 'PerlAuthenHandler' => 'TestHooks::authen_basic', +use Apache::Test (); +if (Apache::Test::have_module('mod_alias.c')) { + push @Alias, ['/perl_sections', '@DocumentRoot@']; + $Location{'/perl_sections'} = { + 'PerlInitHandler' => 'ModPerl::Test::add_config', + 'AuthType' => 'Basic', + 'AuthName' => 'PerlSection', + 'PerlAuthenHandler' => 'TestHooks::authen_basic', }; +} </Perl> <Perl > @@ -47,14 +50,17 @@ #Deprecated access to Apache2::ReadConfig:: still works <Perl > -push @Apache2::ReadConfig::Alias, - ['/perl_sections_readconfig', '@DocumentRoot@']; -$Apache2::ReadConfig::Location{'/perl_sections_readconfig'} = { - 'PerlInitHandler' => 'ModPerl::Test::add_config', - 'AuthType' => 'Basic', - 'AuthName' => 'PerlSection', - 'PerlAuthenHandler' => 'TestHooks::authen_basic', +use Apache::Test (); +if (Apache::Test::have_module('mod_alias.c')) { + push @Apache2::ReadConfig::Alias, + ['/perl_sections_readconfig', '@DocumentRoot@']; + $Apache2::ReadConfig::Location{'/perl_sections_readconfig'} = { + 'PerlInitHandler' => 'ModPerl::Test::add_config', + 'AuthType' => 'Basic', + 'AuthName' => 'PerlSection', + 'PerlAuthenHandler' => 'TestHooks::authen_basic', }; +} </Perl> ### --------------------------------- ### Modified: perl/modperl/trunk/t/directive/perl.t URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/directive/perl.t?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/directive/perl.t (original) +++ perl/modperl/trunk/t/directive/perl.t Tue May 24 11:38:46 2005 @@ -4,7 +4,7 @@ use Apache::Test; use Apache::TestRequest; -plan tests => 8, need need_auth, 'HTML::HeadParser'; +plan tests => 8, need need_auth, 'mod_alias.c', 'HTML::HeadParser'; #so we don't have to require lwp my @auth = (Authorization => 'Basic ZG91Z206Zm9v'); #dougm:foo Modified: perl/modperl/trunk/t/filter/TestFilter/out_str_lc.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/filter/TestFilter/out_str_lc.pm?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/filter/TestFilter/out_str_lc.pm (original) +++ perl/modperl/trunk/t/filter/TestFilter/out_str_lc.pm Tue May 24 11:38:46 2005 @@ -30,5 +30,6 @@ <Location /top_dir> PerlOutputFilterHandler TestFilter::out_str_lc </Location> - -Alias /top_dir @top_dir@ +<IfModule mod_alias.c> + Alias /top_dir @top_dir@ +</IfModule> Modified: perl/modperl/trunk/t/filter/TestFilter/out_str_subreq_default.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/filter/TestFilter/out_str_subreq_default.pm?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/filter/TestFilter/out_str_subreq_default.pm (original) +++ perl/modperl/trunk/t/filter/TestFilter/out_str_subreq_default.pm Tue May 24 11:38:46 2005 @@ -72,7 +72,10 @@ PerlResponseHandler TestFilter::out_str_subreq_default::response PerlOutputFilterHandler TestFilter::out_str_subreq_default::include -Alias /default_subrequest @DocumentRoot@/filter +<IfModule mod_alias.c> + Alias /default_subrequest @DocumentRoot@/filter +</IfModule> + <Location /default_subrequest> - SetHandler default-handler + SetHandler default-handler </Location> Modified: perl/modperl/trunk/t/filter/out_str_lc.t URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/filter/out_str_lc.t?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/filter/out_str_lc.t (original) +++ perl/modperl/trunk/t/filter/out_str_lc.t Tue May 24 11:38:46 2005 @@ -4,7 +4,7 @@ use Apache::Test; use Apache::TestRequest; -plan tests => 1; +plan tests => 1, need 'mod_alias'; my $location = "/top_dir/Makefile"; Modified: perl/modperl/trunk/t/filter/out_str_subreq_default.t URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/filter/out_str_subreq_default.t?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/filter/out_str_subreq_default.t (original) +++ perl/modperl/trunk/t/filter/out_str_subreq_default.t Tue May 24 11:38:46 2005 @@ -6,7 +6,7 @@ use Apache::TestUtil; use Apache::TestConfig (); -plan tests => 1; +plan tests => 1, need 'mod_alias'; my $location = '/TestFilter__out_str_subreq_default'; Modified: perl/modperl/trunk/t/modules/include.t URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modules/include.t?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/modules/include.t (original) +++ perl/modperl/trunk/t/modules/include.t Tue May 24 11:38:46 2005 @@ -13,8 +13,8 @@ 'footer', ); -plan tests => 2 + @patterns, need need_module('include'), - need_min_module_version(CGI => 3.08); +plan tests => 2 + @patterns, need need_module('include', 'mod_mime'), + need_min_module_version(CGI => 3.08); my $location = "/includes/test.shtml"; Modified: perl/modperl/trunk/t/modules/include2.t URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modules/include2.t?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/modules/include2.t (original) +++ perl/modperl/trunk/t/modules/include2.t Tue May 24 11:38:46 2005 @@ -12,7 +12,7 @@ 'mod_perl', #SERVER_SOFTWARE ); -plan tests => 2 + @patterns, ['include', 'HTML::HeadParser']; +plan tests => 2 + @patterns, ['include', 'mod_mime', 'HTML::HeadParser']; my $location = "/includes-registry/test.spl"; Modified: perl/modperl/trunk/t/response/TestAPI/request_rec.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestAPI/request_rec.pm?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/response/TestAPI/request_rec.pm (original) +++ perl/modperl/trunk/t/response/TestAPI/request_rec.pm Tue May 24 11:38:46 2005 @@ -176,8 +176,21 @@ my $def = [qw(fr)]; #default value my $l = [qw(fr us cn)]; #new value - ok t_cmp $r->content_languages, $def, '$r->content_languages'; - ok t_cmp $r->content_languages($l), $def, '$r->content_languages'; + if (have_module('mod_mime')) { + ok t_cmp $r->content_languages, $def, '$r->content_languages'; + } + else { + skip "Need mod_mime", 0; + } + + my $old = $r->content_languages($l); + if (have_module('mod_mime')) { + ok t_cmp $old, $def, '$r->content_languages'; + } + else { + skip "Need mod_mime", 0; + } + ok t_cmp $r->content_languages, $l, '$r->content_languages'; eval { $r->content_languages({}) }; @@ -238,5 +251,13 @@ 1; __END__ -PerlOptions +GlobalRequest -DefaultLanguage fr +<NoAutoConfig> +<Location /TestAPI__request_rec> + PerlOptions +GlobalRequest + <IfModule mod_mime.c> + DefaultLanguage fr + </IfModule> + SetHandler modperl + PerlResponseHandler TestAPI::request_rec +</Location> +</NoAutoConfig> Modified: perl/modperl/trunk/t/response/TestAPI/slurp_filename.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestAPI/slurp_filename.pm?rev=178236&r1=178235&r2=178236&view=diff ============================================================================== --- perl/modperl/trunk/t/response/TestAPI/slurp_filename.pm (original) +++ perl/modperl/trunk/t/response/TestAPI/slurp_filename.pm Tue May 24 11:38:46 2005 @@ -22,7 +22,7 @@ sub handler { my $r = shift; - plan $r, tests => 5; + plan $r, tests => 5, need 'mod_alias'; { my $data = $r->slurp_filename(0); # untainted @@ -69,7 +69,9 @@ 1; __END__ <NoAutoConfig> - Alias /slurp/ @DocumentRoot@/api/ + <IfModule mod_alias.c> + Alias /slurp/ @DocumentRoot@/api/ + </IfModule> <Location /slurp/> SetHandler modperl PerlResponseHandler TestAPI::slurp_filename