On Monday, June 30, 2003, at 12:11 PM, David Wheeler wrote:
BEGIN{ if (eval {require Apache::Test}) { Apache::Test->import(qw(have_lwp plan)); require Apache::TestRequest; Apache::TestRequest->import(qw(GET POST)); plan tests => 43, have_lwp; } else { plan skip_all => 'Apache::Test required to run tests.'; } }
Actually, to make it cooperate with Test::More, I had to do this:
BEGIN { if (eval {require Apache::Test}) { if (Apache::Test::have_lwp()) { require Apache::TestRequest; Apache::TestRequest->import(qw(GET POST)); plan tests => 43; } else { plan skip_all => 'libwww-perl is not installed'; } } else { plan skip_all => 'Apache::Test required to run tests'; } }
David, also please check the latest Apache::Peek on CPAN, I have started abstracting this functionality especially for complex builds which has to support both mod_perl versions. I haven't finished yet, but since pretty much all Apache:: module authors will need this code, rather than duplicating it we better have a special module (which can be at least bundled to start with).
Another approach is to use Module::Install, which I haven't tried yet, but which is supposed to resolve this kind of a problem generically.
__________________________________________________________________ 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