X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Foptional_lighttpd-fastcgi.t;h=1d3ca400625d67ff5646c4b3db0a2dcc434c2dbb;hp=9e4daf1afccae39ba93f6d519fd8ef10aae44e17;hb=8ae46e9876d7f0285d7a71eb3669a593a26ef4bb;hpb=f3d2ec61cac867693834d3093c9dff7891e3e3f5 diff --git a/t/optional_lighttpd-fastcgi.t b/t/optional_lighttpd-fastcgi.t index 9e4daf1..1d3ca40 100644 --- a/t/optional_lighttpd-fastcgi.t +++ b/t/optional_lighttpd-fastcgi.t @@ -12,17 +12,19 @@ use FindBin; use IO::Socket; use Config (); -eval "use FCGI"; -plan skip_all => 'FCGI required' if $@; +BEGIN { + eval "use FCGI"; + plan skip_all => 'FCGI required' if $@; -eval "use Catalyst::Devel 1.0"; -plan skip_all => 'Catalyst::Devel required' if $@; + eval "use File::Copy::Recursive"; + plan skip_all => 'File::Copy::Recursive required' if $@; -eval "use File::Copy::Recursive"; -plan skip_all => 'File::Copy::Recursive required' if $@; + eval "use Test::Harness"; + plan skip_all => 'Test::Harness required' if $@; +} -eval "use Test::Harness"; -plan skip_all => 'Test::Harness required' if $@; +use lib 't/lib'; +use MakeTestApp; my $lighttpd_bin = $ENV{LIGHTTPD_BIN} || `which lighttpd`; chomp $lighttpd_bin; @@ -32,18 +34,8 @@ plan skip_all => 'Please set LIGHTTPD_BIN to the path to lighttpd' plan tests => 1; -# clean up -rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp"; - -# create a TestApp and copy the test libs into it -mkdir "$FindBin::Bin/../t/tmp"; -chdir "$FindBin::Bin/../t/tmp"; -system "$^X -I$FindBin::Bin/../lib $FindBin::Bin/../script/catalyst.pl TestApp"; -chdir "$FindBin::Bin/.."; -File::Copy::Recursive::dircopy( 't/lib', 't/tmp/TestApp/lib' ); - -# remove TestApp's tests -rmtree 't/tmp/TestApp/t'; +# this creates t/tmp/TestApp +make_test_app; # Create a temporary lighttpd config my $docroot = "$FindBin::Bin/../t/tmp";