Fixed Apache tests so they don't prompt for config information
[catagits/Catalyst-Runtime.git] / t / optional / apache-cgi.pl
CommitLineData
58f5682a 1#!perl
2
3# Run all tests against CGI 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-cgi.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
dd3af04e 33$ENV{CATALYST_SERVER} = 'http://localhost:8529/cgi';
58f5682a 34
35Apache::TestRun->new->run(@ARGV);
36
37# clean up
38rmtree "$FindBin::Bin/../../t/var" if -d "$FindBin::Bin/../../t/var";