From: Andy Grundman Date: Thu, 20 Oct 2005 21:10:01 +0000 (+0000) Subject: Changed http tests to use t/tmp instead of t/var X-Git-Tag: 5.7099_04~1163 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=10bdcbe8078d0136e2bc53f47ea1f63e36c947a8 Changed http tests to use t/tmp instead of t/var --- diff --git a/t/optional/apache-cgi.pl b/t/optional/apache-cgi.pl index 0eac65c..7864b39 100755 --- a/t/optional/apache-cgi.pl +++ b/t/optional/apache-cgi.pl @@ -18,21 +18,21 @@ use File::Copy::Recursive; use FindBin; # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +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/var"; -chdir "$FindBin::Bin/../../t/var"; +mkdir "$FindBin::Bin/../../t/tmp"; +chdir "$FindBin::Bin/../../t/tmp"; system "$FindBin::Bin/../../script/catalyst.pl TestApp"; chdir "$FindBin::Bin/../.."; -File::Copy::Recursive::dircopy( 't/live/lib', 't/var/TestApp/lib' ); +File::Copy::Recursive::dircopy( 't/live/lib', 't/tmp/TestApp/lib' ); # remove TestApp's tests so Apache::Test doesn't try to run them -rmtree 't/var/TestApp/t'; +rmtree 't/tmp/TestApp/t'; $ENV{CATALYST_SERVER} = 'http://localhost:8529/cgi'; Apache::TestRun->new->run(@ARGV); # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +rmtree "$FindBin::Bin/../../t/tmp" if -d "$FindBin::Bin/../../t/tmp"; diff --git a/t/optional/apache-fastcgi.pl b/t/optional/apache-fastcgi.pl index a4c2a52..68f095c 100755 --- a/t/optional/apache-fastcgi.pl +++ b/t/optional/apache-fastcgi.pl @@ -18,21 +18,21 @@ use File::Copy::Recursive; use FindBin; # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +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/var"; -chdir "$FindBin::Bin/../../t/var"; +mkdir "$FindBin::Bin/../../t/tmp"; +chdir "$FindBin::Bin/../../t/tmp"; system "$FindBin::Bin/../../script/catalyst.pl TestApp"; chdir "$FindBin::Bin/../.."; -File::Copy::Recursive::dircopy( 't/live/lib', 't/var/TestApp/lib' ); +File::Copy::Recursive::dircopy( 't/live/lib', 't/tmp/TestApp/lib' ); # remove TestApp's tests so Apache::Test doesn't try to run them -rmtree 't/var/TestApp/t'; +rmtree 't/tmp/TestApp/t'; $ENV{CATALYST_SERVER} = 'http://localhost:8529/fastcgi'; Apache::TestRun->new->run(@ARGV); # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +rmtree "$FindBin::Bin/../../t/tmp" if -d "$FindBin::Bin/../../t/tmp"; diff --git a/t/optional/http-server-restart.t b/t/optional/http-server-restart.t index f9d4a9e..a002ee3 100644 --- a/t/optional/http-server-restart.t +++ b/t/optional/http-server-restart.t @@ -19,19 +19,22 @@ plan skip_all => 'File::Copy::Recursive required' if $@; plan tests => 40; # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +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/var"; -chdir "$FindBin::Bin/../../t/var"; +mkdir "$FindBin::Bin/../../t/tmp"; +chdir "$FindBin::Bin/../../t/tmp"; system "perl -I$FindBin::Bin/../../lib $FindBin::Bin/../../script/catalyst.pl TestApp"; chdir "$FindBin::Bin/../.."; -File::Copy::Recursive::dircopy( 't/live/lib', 't/var/TestApp/lib' ); +File::Copy::Recursive::dircopy( 't/live/lib', 't/tmp/TestApp/lib' ); + +# remove TestApp's tests +rmtree 't/tmp/TestApp/t'; # spawn the standalone HTTP server my $port = 30000 + int rand(1 + 10000); my $pid = open my $server, - "perl -I$FindBin::Bin/../../lib $FindBin::Bin/../../t/var/TestApp/script/testapp_server.pl -port $port -restart 2>&1 |" + "perl -I$FindBin::Bin/../../lib $FindBin::Bin/../../t/tmp/TestApp/script/testapp_server.pl -port $port -restart 2>&1 |" or die "Unable to spawn standalone HTTP server: $!"; # wait for it to start @@ -42,9 +45,9 @@ while ( check_port( 'localhost', $port ) != 1 ) { # change various files my @files = ( - "$FindBin::Bin/../../t/var/TestApp/lib/TestApp.pm", - "$FindBin::Bin/../../t/var/TestApp/lib/TestApp/Controller/Action/Begin.pm", - "$FindBin::Bin/../../t/var/TestApp/lib/TestApp/Controller/Engine/Request/URI.pm", + "$FindBin::Bin/../../t/tmp/TestApp/lib/TestApp.pm", + "$FindBin::Bin/../../t/tmp/TestApp/lib/TestApp/Controller/Action/Begin.pm", + "$FindBin::Bin/../../t/tmp/TestApp/lib/TestApp/Controller/Engine/Request/URI.pm", ); # change some files and make sure the server restarts itself @@ -93,7 +96,7 @@ kill 'INT', $pid; close $server; # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +rmtree "$FindBin::Bin/../../t/tmp" if -d "$FindBin::Bin/../../t/tmp"; sub check_port { my ( $host, $port ) = @_; diff --git a/t/optional/http-server.t b/t/optional/http-server.t index ec03c35..a518df0 100644 --- a/t/optional/http-server.t +++ b/t/optional/http-server.t @@ -14,19 +14,22 @@ plan skip_all => 'File::Copy::Recursive required' if $@; plan tests => 1; # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +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/var"; -chdir "$FindBin::Bin/../../t/var"; +mkdir "$FindBin::Bin/../../t/tmp"; +chdir "$FindBin::Bin/../../t/tmp"; system "perl -I$FindBin::Bin/../../lib $FindBin::Bin/../../script/catalyst.pl TestApp"; chdir "$FindBin::Bin/../.."; -File::Copy::Recursive::dircopy( 't/live/lib', 't/var/TestApp/lib' ); +File::Copy::Recursive::dircopy( 't/live/lib', 't/tmp/TestApp/lib' ); + +# remove TestApp's tests +rmtree 't/tmp/TestApp/t'; # spawn the standalone HTTP server my $port = 30000 + int rand(1 + 10000); my $pid = open my $server, - "perl -I$FindBin::Bin/../../lib $FindBin::Bin/../../t/var/TestApp/script/testapp_server.pl -port $port 2>&1 |" + "perl -I$FindBin::Bin/../../lib $FindBin::Bin/../../t/tmp/TestApp/script/testapp_server.pl -port $port 2>&1 |" or die "Unable to spawn standalone HTTP server: $!"; # wait for it to start @@ -44,7 +47,7 @@ kill 'INT', $pid; close $server; # clean up -rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var"; +rmtree "$FindBin::Bin/../../t/tmp" if -d "$FindBin::Bin/../../t/tmp"; ok( 'done' );