Skip more 025-debug tests on Windows

Redirecting stderr doesn't seem to work. Also fix skip count.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/355da9a6
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/355da9a6
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/355da9a6

Branch: refs/heads/master
Commit: 355da9a659b17fbe245c614014b599526a3f086c
Parents: df92734
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Sat Dec 24 15:18:25 2016 +0100
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Mon Jan 2 16:33:56 2017 +0100

----------------------------------------------------------------------
 perl/t/025-debug.t | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/355da9a6/perl/t/025-debug.t
----------------------------------------------------------------------
diff --git a/perl/t/025-debug.t b/perl/t/025-debug.t
index 674b2fe..ef9be1e 100644
--- a/perl/t/025-debug.t
+++ b/perl/t/025-debug.t
@@ -41,21 +41,23 @@ BEGIN {
     }
 }
 
-my $stderr_dumpfile = catfile( working_dir(), 'lucy_garbage' );
-unlink $stderr_dumpfile;
-sysopen( STDERR, $stderr_dumpfile, O_CREAT | O_WRONLY | O_EXCL )
-    or die "Failed to redirect STDERR";
-
-DEBUG_PRINT("Roach Motel");
-like( slurp_file($stderr_dumpfile), qr/Roach Motel/, "DEBUG_PRINT" );
+my $stderr_dumpfile;
 
 ASSERT(1);
 pass("ASSERT(true) didn't die");
 
 SKIP: {
-    skip( "Windows fork not supported by Lucy", 3 )
+    skip( "Windows redirect and fork not supported by Lucy", 6 )
         if $^O =~ /(mswin|cygwin)/i;
 
+    $stderr_dumpfile = catfile( working_dir(), 'lucy_garbage' );
+    unlink $stderr_dumpfile;
+    sysopen( STDERR, $stderr_dumpfile, O_CREAT | O_WRONLY | O_EXCL )
+        or die "Failed to redirect STDERR";
+
+    DEBUG_PRINT("Roach Motel");
+    like( slurp_file($stderr_dumpfile), qr/Roach Motel/, "DEBUG_PRINT" );
+
     my $stderr_out = capture_debug( 'Lucy.xs', 'Borax' );
     like( $stderr_out, qr/Borax/, "DEBUG - file name" );
 
@@ -78,14 +80,14 @@ SKIP: {
             "failing ASSERT"
         );
     }
-}
 
-set_env_cache("");
-DEBUG("Slug and Snail Death");
-unlike( slurp_file($stderr_dumpfile), qr/Slug/, "DEBUG disabled by default" );
+    set_env_cache("");
+    DEBUG("Slug and Snail Death");
+    unlike( slurp_file($stderr_dumpfile), qr/Slug/, "DEBUG disabled by 
default" );
 
-# Clean up.
-unlink $stderr_dumpfile;
+    # Clean up.
+    unlink $stderr_dumpfile;
+}
 
 sub capture_debug {
     my ( $fake_env_var, $debug_string ) = @_;

Reply via email to