X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fauthor%2Fhttp-server.t;h=ead1cad58d33c893e94ab78679c499f6c32353c2;hb=86b73ee025f705d9f25d1970d2c438c00d9d1076;hp=0edba014283f6b1808b28ace93ec761d370ec313;hpb=1316cc6465a09bcc5755b8b60f321ec7f2585eb8;p=catagits%2FCatalyst-Runtime.git diff --git a/t/author/http-server.t b/t/author/http-server.t index 0edba01..ead1cad 100644 --- a/t/author/http-server.t +++ b/t/author/http-server.t @@ -9,8 +9,15 @@ use Test::TCP; use Try::Tiny; use Plack::Builder; -use Catalyst::Devel 1.0; -use File::Copy::Recursive; +eval { require Catalyst::Devel; Catalyst::Devel->VERSION(1.0); 1; } || do { + fail("Could not load Catalyst::Devel: $@"); + exit 1; +}; + +eval { require File::Copy::Recursive; 1 } || do { + fail("Could not load File::Copy::Recursive: $@"); + exit 1; +}; # Run a single test by providing it as the first arg my $single_test = shift; @@ -77,6 +84,15 @@ rmtree "$FindBin::Bin/../../t/tmp" if -d "$FindBin::Bin/../../t/tmp"; is( $return, 0, 'live tests' ); +# kill 'INT' doesn't exist in Windows, so to prevent child hanging, +# this process will need to commit seppuku to clean up the children. +if ($^O eq 'MSWin32') { + # Furthermore, it needs to do it 'politely' so that TAP doesn't + # smell anything 'dubious'. + require Win32::Process; # core in all versions of Win32 Perl + Win32::Process::KillProcess($$, $return); +} + sub wait_port_timeout { my ($port, $timeout) = @_;