1 # Run all tests against FastCGI mode under Apache
3 # Note, to get this to run properly, you may need to give it the path to your
6 # perl t/optional_apache-fastcgi-non-root.pl -httpd_conf /etc/apache/httpd.conf
12 use Apache::TestRun ();
15 use File::Copy::Recursive;
20 rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp";
22 # create a TestApp and copy the test libs into it
23 mkdir "$FindBin::Bin/../t/tmp";
24 chdir "$FindBin::Bin/../t/tmp";
25 system "$FindBin::Bin/../script/catalyst.pl TestApp";
26 chdir "$FindBin::Bin/..";
27 File::Copy::Recursive::dircopy( 't/lib', 't/tmp/TestApp/lib' );
29 # remove TestApp's tests so Apache::Test doesn't try to run them
30 rmtree 't/tmp/TestApp/t';
32 $ENV{CATALYST_SERVER} = 'http://localhost:8529/fastcgi/deep/path';
34 if ( !-e 't/optional_apache-fastcgi.pl' ) {
35 die "ERROR: Please run test from the Catalyst-Runtime directory\n";
38 push @ARGV, glob( 't/aggregate/live_*' );
40 Apache::TestRun->new->run(@ARGV);
42 # clean up if the server has shut down
43 # this allows the test files to stay around if the user ran -start-httpd
44 if ( !check_port( 'localhost', 8529 ) ) {
45 rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp";
49 my ( $host, $port ) = @_;
51 my $remote = IO::Socket::INET->new(