Subject: | [PATCH] Print $! to STDERR on socketpair test failures |
t/socketpair.t is failing on Cygwin before 5.20, but CPANtesters is not giving much clue to what the failure is, because the diagnostic only goes to stdout.
The attached patch makes all the diagnostic prints of $! go to STDERR instead.
- ilmari
Subject: | 0001-Print-to-STDERR-on-socketpair-test-failures.patch |
From 41fc69f006f36e75ee5d7c728733254c0324db96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Sat, 28 Oct 2017 15:59:42 +0100
Subject: [PATCH 1/2] Print $! to STDERR on socketpair test failures
So it shows up even in non-verbose test output.
---
t/socketpair.t | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/socketpair.t b/t/socketpair.t
index 823306e..cb11e26 100644
--- a/t/socketpair.t
+++ b/t/socketpair.t
@@ -83,7 +83,7 @@ $SIG{ALRM} = sub {die "Unexpected alarm during testing"};
ok (socketpair (LEFT, RIGHT, AF_UNIX, SOCK_STREAM, PF_UNSPEC),
"socketpair (LEFT, RIGHT, AF_UNIX, SOCK_STREAM, PF_UNSPEC)")
- or print "# \$\! = $!\n";
+ or print STDERR "# \$\! = $!\n";
if ($has_perlio) {
binmode(LEFT, ":bytes");
@@ -148,7 +148,7 @@ $SIG{PIPE} = 'IGNORE';
# should help
$! = $err;
ok (($!{EPIPE} or $!{ESHUTDOWN}), '$! should be EPIPE or ESHUTDOWN')
- or printf "\$\!=%d(%s)\n", $err, $err;
+ or printf STDERR "# \$\! = %d (%s)\n", $err, $err;
}
my @gripping = (chr 255, chr 127);
@@ -178,7 +178,7 @@ SKIP: {
ok (socketpair (LEFT, RIGHT, AF_UNIX, SOCK_DGRAM, PF_UNSPEC),
"socketpair (LEFT, RIGHT, AF_UNIX, SOCK_DGRAM, PF_UNSPEC)")
- or print "# \$\! = $!\n";
+ or print STDERR "# \$\! = $!\n";
if ($has_perlio) {
binmode(LEFT, ":bytes");
--
2.7.4