my $childpid = fork();
my $port = 3333; # or call some random generator
+my $tmpfile = tmpnam(); # do not redirect to /dev/null as it will not work on Win32
if ($childpid == 0) {
- my $tmpfile = tmpnam(); # do not redirect to /dev/null as it will not work on Win32
system("$^X $server_path -p $port > $tmpfile 2>&1");
- unlink $tmpfile;
exit;
}
$mech->get_ok( "http://localhost:" . $port );
kill 'KILL', $childpid;
-
+unlink $tmpfile;