Added automated tests for CGI and FastCGI using Apache::Test
[catagits/Catalyst-Runtime.git] / t / optional / apache-fastcgi.pl
1 #!perl
2
3 # Run all tests against FastCGI mode under Apache
4 #
5 # Note, to get this to run properly, you may need to give it the path to your
6 # httpd.conf:
7
8 # perl t/optional/apache-fastcgi.pl -httpd_conf /etc/apache/httpd.conf
9
10 use strict;
11 use warnings;
12
13 use Apache::Test;
14 use Apache::TestRun ();
15
16 use File::Path;
17 use File::Copy::Recursive;
18 use FindBin;
19
20 # clean up
21 rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var";
22
23 # create a TestApp and copy the test libs into it
24 mkdir "$FindBin::Bin/../../t/var";
25 chdir "$FindBin::Bin/../../t/var";
26 system "$FindBin::Bin/../../script/catalyst.pl TestApp";
27 chdir "$FindBin::Bin/../..";
28 File::Copy::Recursive::dircopy( 't/live/lib', 't/var/TestApp/lib' );
29
30 # remove TestApp's tests so Apache::Test doesn't try to run them
31 rmtree 't/var/TestApp/t';
32
33 my $cfg  = Apache::Test::config();
34 $ENV{CATALYST_SERVER} = 'http://' . $cfg->hostport . '/fastcgi';
35
36 Apache::TestRun->new->run(@ARGV);
37
38 # clean up
39 rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var";