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=9e4daf1afccae39ba93f6d519fd8ef10aae44e17;hp=98567f74c64d355ab0d1fb365dca1be3d3479001;hb=f3d2ec61cac867693834d3093c9dff7891e3e3f5;hpb=ae29b412955743885e80350085167b54b69672da diff --git a/t/optional_lighttpd-fastcgi.t b/t/optional_lighttpd-fastcgi.t index 98567f7..9e4daf1 100644 --- a/t/optional_lighttpd-fastcgi.t +++ b/t/optional_lighttpd-fastcgi.t @@ -1,5 +1,3 @@ -#!perl - use strict; use warnings; @@ -12,6 +10,7 @@ BEGIN { use File::Path; use FindBin; use IO::Socket; +use Config (); eval "use FCGI"; plan skip_all => 'FCGI required' if $@; @@ -51,7 +50,9 @@ my $docroot = "$FindBin::Bin/../t/tmp"; my $port = 8529; # Clean up docroot path -$docroot =~ s{/t/..}{}; +$docroot =~ s{/t/\.\.}{}; + +my $perl5lib = join($Config::Config{path_sep}, "$docroot/../../lib", $ENV{PERL5LIB} || ()); my $conf = <<"END"; # basic lighttpd config file for testing fcgi+catalyst @@ -80,21 +81,21 @@ fastcgi.server = ( "max-procs" => 1, "idle-timeout" => 20, "bin-environment" => ( - "PERL5LIB" => "$docroot/../../lib" + "PERL5LIB" => "$perl5lib" ) ) ) ) END -open(my $lightconf, '>', "$docroot/lighttpd.conf") +open(my $lightconf, '>', "$docroot/lighttpd.conf") or die "Can't open $docroot/lighttpd.conf: $!"; print {$lightconf} $conf or die "Write error: $!"; close $lightconf; -my $pid = open my $lighttpd, "$lighttpd_bin -D -f $docroot/lighttpd.conf 2>&1 |" +my $pid = open my $lighttpd, "$lighttpd_bin -D -f $docroot/lighttpd.conf 2>&1 |" or die "Unable to spawn lighttpd: $!"; - + # wait for it to start while ( check_port( 'localhost', $port ) != 1 ) { diag "Waiting for server to start...";