Re: Fwd: Re: Apache::DBI as a prerequisite
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On July 30, 2002 10:02 pm, Stas Bekman wrote: 2) See http://perl.apache.org/docs/2.0/devel/testing/testing.html Though you can really rely on it once Apache::Test is released, which will happen when mod_perl 2.0 is released. 1) That's an interesting problem. It seems that nobody has asked this question before. Here is my take on it. If you like this solution I'll add it to the docs. Thanks a lot. Your solution for Apache::DBI works and is very Perlish! - -- Simon Perreault [EMAIL PROTECTED] Web: http://www.linuxquebec.com/~nomis80 PGP: $Web/nomis80.gpg -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9R94IqaCdwBMK2KkRAn9IAKCJ7UlIztV6MlThz8Y79b7+FbEGAQCZAdE+ 3yP5wB/0udz2Rkgkvh+2S4U= =ETSh -END PGP SIGNATURE-
Re: Fwd: Re: Apache::DBI as a prerequisite
Simon Perrault wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On July 30, 2002 10:02 pm, Stas Bekman wrote: 2) See http://perl.apache.org/docs/2.0/devel/testing/testing.html Though you can really rely on it once Apache::Test is released, which will happen when mod_perl 2.0 is released. 1) That's an interesting problem. It seems that nobody has asked this question before. Here is my take on it. If you like this solution I'll add it to the docs. Thanks a lot. Your solution for Apache::DBI works and is very Perlish! Great. I've put it here: http://perl.apache.org/docs/general/cpan_mod_dev/cpan_mod_dev.html __ Stas BekmanJAm_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
Fwd: Re: Apache::DBI as a prerequisite
Could you please take a look at this problem? Thanks. - Forwarded message from Stas Bekman [EMAIL PROTECTED] - Date: Mon, 29 Jul 2002 09:56:05 +0800 From: Stas Bekman [EMAIL PROTECTED] Reply-To: Stas Bekman [EMAIL PROTECTED] Subject: Re: Apache::DBI as a prerequisite To: Simon Perrault [EMAIL PROTECTED] Simon, please repost to the modperl list and we will discuss it there. Thanks. Simon Perrault wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, You wrote on 2002-04-30 to apache-modperl about Apache::DBI not being testable while not under mod_perl. You said this: That's normal. You cannot test modules that use mod_perl API without running them inside mod_perl server. I've the same problem as you've reported. This test suite is simple broken. ... All Apache:: module authors should be moving to use the new Apache::Test framework soon, since it lets you test the code under running mod_perl server and works with both versions of httpd/mod_perl. This is exactly my situation. I develop a module which requires Apache::DBI, so I include it in my Makefile.PL like this: WriteMakefile( 'PREREQ_PM'= { 'Apache::DBI' = 0, }, ); But that prints a warning because Apache::DBI can't find Apache::module(), which is only available under mod_perl. My question: 1) Can you tell me (or guide me toward some information) how I can properly add Apache::DBI as a prerequisite so that it doesn't print a warning (which is the subjet of 90% of user emails)? 2) How can I test my module running Apache::DBI with Apache::Test? Thanks a lot - -- Simon Perreault [EMAIL PROTECTED] Web: http://www.linuxquebec.com/~nomis80 PGP: $Web/nomis80.gpg -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9QwYAqaCdwBMK2KkRAt+pAJ9knR94Tz5jmBFCyO/hL/fNWwHzmwCfZSl0 66Chb76wE6YcgR6JbxYpQEc= =4xfy -END PGP SIGNATURE- -- __ Stas BekmanJAm_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 - End forwarded message - -- Simon Perreault [EMAIL PROTECTED] Web: http://www.linuxquebec.com/~nomis80 PGP: $Web/nomis80.gpg
Re: Fwd: Re: Apache::DBI as a prerequisite
Simon Perreault wrote: You wrote on 2002-04-30 to apache-modperl about Apache::DBI not being testable while not under mod_perl. You said this: That's normal. You cannot test modules that use mod_perl API without running them inside mod_perl server. I've the same problem as you've reported. This test suite is simple broken. ... All Apache:: module authors should be moving to use the new Apache::Test framework soon, since it lets you test the code under running mod_perl server and works with both versions of httpd/mod_perl. This is exactly my situation. I develop a module which requires Apache::DBI, so I include it in my Makefile.PL like this: WriteMakefile( 'PREREQ_PM'= { 'Apache::DBI' = 0, }, ); But that prints a warning because Apache::DBI can't find Apache::module(), which is only available under mod_perl. My question: 1) Can you tell me (or guide me toward some information) how I can properly add Apache::DBI as a prerequisite so that it doesn't print a warning (which is the subjet of 90% of user emails)? 2) How can I test my module running Apache::DBI with Apache::Test? I'll answer these in reverse: 2) See http://perl.apache.org/docs/2.0/devel/testing/testing.html Though you can really rely on it once Apache::Test is released, which will happen when mod_perl 2.0 is released. 1) That's an interesting problem. It seems that nobody has asked this question before. Here is my take on it. If you like this solution I'll add it to the docs. Makefile.PL --- use ExtUtils::MakeMaker; # set prerequisites my %prereq = ( Foo = 1.56, ); # Manually test whether Apache::DBI is installed and add it to the # PREREQ_PM if it's not installed, so CPAN.pm will automatically fetch # it. If Apache::DBI is already installed it will fail to get loaded by # MakeMaker because it requires the mod_perl environment to load. eval { require Apache::DBI }; if ($@ $@ !~ /Can't locate object method/) { $prereq{Apache::DBI} = ''; } WriteMakefile( NAME = 'Apache::SuperDuper', VERSION_FROM = 'SuperDuper.pm', PREREQ_PM = \%prereq, # ... ); __ Stas BekmanJAm_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