Added automated tests for CGI and FastCGI using Apache::Test
[catagits/Catalyst-Runtime.git] / t / optional / apache-fastcgi.pl
CommitLineData
58f5682a 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
10use strict;
11use warnings;
12
13use Apache::Test;
14use Apache::TestRun ();
15
16use File::Path;
17use File::Copy::Recursive;
18use FindBin;
19
20# clean up
21rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var";
22
23# create a TestApp and copy the test libs into it
24mkdir "$FindBin::Bin/../../t/var";
25chdir "$FindBin::Bin/../../t/var";
26system "$FindBin::Bin/../../script/catalyst.pl TestApp";
27chdir "$FindBin::Bin/../..";
28File::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
31rmtree 't/var/TestApp/t';
32
33my $cfg = Apache::Test::config();
34$ENV{CATALYST_SERVER} = 'http://' . $cfg->hostport . '/fastcgi';
35
36Apache::TestRun->new->run(@ARGV);
37
38# clean up
39rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var";