Fix author requires to not fatally error on a single command Fix author test platform...
[catagits/Catalyst-Runtime.git] / t / author / http-server.t
index 3bc33a0..2927f18 100644 (file)
@@ -43,7 +43,7 @@ if ($pid) {
     unshift @INC, "$tmpdir/TestApp/lib", "$FindBin::Bin/../../lib";
     require TestApp;
 
-    my $psgi_app = TestApp->_wrapped_legacy_psgi_app(TestApp->psgi_app);
+    my $psgi_app = TestApp->apply_default_middlewares(TestApp->psgi_app);
     Plack::Loader->auto(port => $port)->run(builder {
         mount '/test_prefix' => $psgi_app;
         mount '/' => sub {
@@ -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) = @_;