1 use Test::More tests => 1;
5 BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
6 use File::Temp qw/ tempdir tmpnam /;
9 use lib "$Bin/TestApp/lib";
11 use Test::WWW::Mechanize;
12 use Catalyst::Test 'TestApp';
14 my $dir = tempdir(); # CLEANUP => 1 );
15 my $devnull = File::Spec->devnull;
17 my $server_path = File::Spec->catfile('script', 'testapp_fastcgi.pl');
18 my $port = int(rand(10000)) + 40000; # get random port between 40000-50000
20 my $childpid = fork();
21 die "fork() error, cannot continue" unless defined($childpid);
24 system("$^X $server_path -p $port > $devnull 2>&1");
25 exit; # just for sure; we should never got here
28 sleep 10; #wait for catalyst application to start
29 my $mech = Test::WWW::Mechanize->new;
30 $mech->get_ok( "http://localhost:" . $port );
32 kill 'KILL', $childpid;