Stas Bekman wrote: > Philippe M. Chiasson wrote: > >>Stas Bekman wrote: >> >> >>>>Here are the results you asked for : >>>> >>>>t/TEST -clean >>>>t/TEST -v t/api/module.t t/apr/netlib.t t/compat/conn_rec.t >>>>t/modperl/setupenv.t t/preconnection/note.t >>> >>> >>>Thanks. So it all comes down to two issues. >>> >>>1) Apache::Module::loaded('mod_perl.so') >>> >>> >>> >>> >>>>t/api/module............1..11 >>>># testing : Apache::Module::loaded('mod_perl.so') >>>># expected: 1 >>>># received: 0 >>>>not ok 6 >>> >>> >>>It makes sense that mod_perl.so is not loaded, since it doesn't exist. >>>Philippe, I wonder how this test has passed for you. >> >> >>That's correct, and really, it's a borked test then. It did pass for me once >>strangely, as I managed to have 2 mod_perls in my httpd, a static one and a dso >>loaded one ( can't reproduce that, lol) > > > Shouldn't loaded() be fixed instead to tell you whether mod_perl is linked? Or > was the idea for it to work only for DSO modules?
No, you can chose to check for a DSO module with ->loaded('module.so'). But you can also check for a module with ->loaded('module.c') and that will be true for both static or dso loaded modules. > If it doesn't I can't see any value in this API, since to check mod_perl you > can check $ENV{MOD_PERL} and to check for any other module, you can't really > say that the module is not available if its linked statically. No? Yes, for mod_perl you can check $ENV{MOD_PERL}, but let's say you want to know if mod_autoindex is installed, you check for ->loaded('mod_autoindex.c') and this will work. Actually, I can't think of a good reason why checking for 'module.so' and not 'module.c' would make sense. > >>Index: t/response/TestAPI/module.pm >>=================================================================== >>RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v >>retrieving revision 1.9 >>diff -u -I$Id -r1.9 module.pm >>--- t/response/TestAPI/module.pm 8 Apr 2004 01:56:31 -0000 1.9 >>+++ t/response/TestAPI/module.pm 6 May 2004 20:24:04 -0000 >>@@ -7,6 +7,7 @@ >> use Apache::Test; >> use Apache::TestConfig; >> use Apache::TestUtil; >>+use Apache::BuildConfig; >> >> use Apache::Module (); >> use DynaLoader (); >>@@ -84,9 +85,12 @@ >> "Apache::Module::loaded('Apache__Module_foo.c')"); >> >> #.so >>- ok t_cmp(1, Apache::Module::loaded('mod_perl.so'), >>+ { >>+ my $expect = Apache::BuildConfig->new->{MP_USE_STATIC} ? 0 : 1; >>+ ok t_cmp($expect, Apache::Module::loaded('mod_perl.so'), >> "Apache::Module::loaded('mod_perl.so')"); >>- >>+ } >>+ >> ok t_cmp(0, Apache::Module::loaded('Apache__Module__foo.so'), >> "Apache::Module::loaded('Apache__Module_foo.so')"); > > > __________________________________________________________________ > Stas Bekman JAm_pH ------> Just Another mod_perl Hacker > http://stason.org/ mod_perl Guide ---> http://perl.apache.org > mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com > http://modperlbook.org http://apache.org http://ticketmaster.com > -- -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5 -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html