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;
13 my $dir = tempdir(); # CLEANUP => 1 );
14 my $devnull = File::Spec->devnull;
16 my $server_path = File::Spec->catfile('script', 'testapp_fastcgi.pl');
17 my $port = int(rand(10000)) + 40000; # get random port between 40000-50000
19 my $childpid = fork();
20 die "fork() error, cannot continue" unless defined($childpid);
23 system("$^X $server_path -p $port > $devnull 2>&1");
24 exit; # just for sure; we should never got here
27 sleep 10; #wait for catalyst application to start
28 my $mech = Test::WWW::Mechanize->new;
29 $mech->get_ok( "http://localhost:" . $port );
31 kill 'KILL', $childpid;