| 1 | use inc::Module::Install; |
|---|
| 2 | BEGIN |
|---|
| 3 | { |
|---|
| 4 | eval { |
|---|
| 5 | die "not testing mod_perl" unless $ENV{TEST_MODPERL}; |
|---|
| 6 | require mod_perl2; |
|---|
| 7 | require Apache::Test; |
|---|
| 8 | }; |
|---|
| 9 | { |
|---|
| 10 | no strict 'refs'; |
|---|
| 11 | *HAVE_MP = $@ ? sub { 0 } : sub { 1 }; |
|---|
| 12 | } |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | if (HAVE_MP) { |
|---|
| 16 | require Apache::TestMM; |
|---|
| 17 | Apache::TestMM->import(qw(clean test)); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | { |
|---|
| 21 | no warnings 'redefine'; |
|---|
| 22 | *recommends_hack = $Module::Install::VERSION > 0.70 ? |
|---|
| 23 | sub { recommends(@_); $_[0] } : |
|---|
| 24 | \&recommends; |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | name 'HTTP-Engine'; |
|---|
| 29 | all_from 'lib/HTTP/Engine.pm'; |
|---|
| 30 | |
|---|
| 31 | requires 'Shika' => '0.01_01'; |
|---|
| 32 | requires 'Scalar::Util' => 1.19; |
|---|
| 33 | |
|---|
| 34 | requires 'File::Copy' => 0; |
|---|
| 35 | requires 'File::Spec::Unix' => 3.2701; |
|---|
| 36 | |
|---|
| 37 | requires 'CGI::Simple::Cookie' => 1.103; |
|---|
| 38 | requires 'HTTP::Body' => '1.04'; |
|---|
| 39 | requires 'HTTP::Headers::Fast' => 0.01; |
|---|
| 40 | requires 'URI' => 1.36; |
|---|
| 41 | |
|---|
| 42 | # prevent tests from failing with HTTP::Server::Simple is present, but |
|---|
| 43 | # but the version is too old. It has no real further dependencies anyway. |
|---|
| 44 | requires 'HTTP::Server::Simple' => 0.35; |
|---|
| 45 | |
|---|
| 46 | requires 'Test::Base' => 0; |
|---|
| 47 | |
|---|
| 48 | features( |
|---|
| 49 | 'Interface::FCGI' => [ |
|---|
| 50 | -default => 0, |
|---|
| 51 | recommends_hack('FCGI' => 0.67), |
|---|
| 52 | ], |
|---|
| 53 | |
|---|
| 54 | 'Interface::ServerSimple' => [ |
|---|
| 55 | -default => 0, |
|---|
| 56 | recommends_hack('HTTP::Server::Simple' => 0.34), |
|---|
| 57 | ], |
|---|
| 58 | |
|---|
| 59 | 'Interface::Standalone' => [ |
|---|
| 60 | -default => 0, |
|---|
| 61 | recommends_hack('Errno' => 1.0901), |
|---|
| 62 | recommends_hack('IO::Socket::INET' => 1.31), |
|---|
| 63 | ], |
|---|
| 64 | |
|---|
| 65 | 'Interface::Test' => [ |
|---|
| 66 | -default => 0, |
|---|
| 67 | recommends_hack('IO::Scalar' => 2.110), |
|---|
| 68 | ], |
|---|
| 69 | |
|---|
| 70 | 'Interface::POE' => [ |
|---|
| 71 | -default => 0, |
|---|
| 72 | recommends_hack('POE' => '1.0003'), |
|---|
| 73 | recommends_hack('POE::Filter::HTTPD' => 1.2387), |
|---|
| 74 | ], |
|---|
| 75 | ); |
|---|
| 76 | |
|---|
| 77 | if (HAVE_MP) { |
|---|
| 78 | Apache::TestMM::filter_args(); |
|---|
| 79 | Apache::TestMM::generate_script('t/TEST'); |
|---|
| 80 | tests('t/*.t t/*/*.t t/modperl/basic.t t/modperl/whole.t'); |
|---|
| 81 | } else { |
|---|
| 82 | tests('t/*.t t/*/*.t '); |
|---|
| 83 | } |
|---|
| 84 | |
|---|
| 85 | build_requires 'Test::More'; |
|---|
| 86 | build_requires 'IO::Scalar'; |
|---|
| 87 | build_requires 'File::Temp' => '0.20'; |
|---|
| 88 | build_requires 'HTTP::Request::AsCGI'; |
|---|
| 89 | build_requires 'Test::TCP' => 0.02; |
|---|
| 90 | build_requires 'IO::Socket' => 1.30; |
|---|
| 91 | build_requires 'IO::File' => 1.14; |
|---|
| 92 | |
|---|
| 93 | use_test_base; |
|---|
| 94 | auto_include; |
|---|
| 95 | WriteAll; |
|---|
| 96 | |
|---|