Fix t/author/http-server.t on Win32
Tomas Doran [Sat, 26 May 2012 10:27:19 +0000 (11:27 +0100)]
Cherry picked out of:

commit 9b8933f1817fd32ef63010739275a7ed7f844ad3
Author: Brendan Byrd <byrd.b@insightcom.com>
Date:   Thu Apr 19 17:35:51 2012 -0400

    Fix author requires to not fatally error on a single command Fix author t

t/author/http-server.t

index 0edba01..2927f18 100644 (file)
@@ -77,6 +77,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) = @_;