summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Leach <richardleach@users.noreply.github.com>2020-03-12 23:56:09 +0000
committerSawyer X <xsawyerx@cpan.org>2020-05-21 00:47:44 +0300
commitd7600dcd5c512385866f75c5418186e024e4c751 (patch)
tree9e75cfcb9174b23f8a9abf1438a79e59a145f2ff
parent56d9fe2f0976a30544c45bec229c1199e2e95396 (diff)
downloadperl-d7600dcd5c512385866f75c5418186e024e4c751.tar.gz
io_unix.t: make tests run on Windows builds if threads + AF_UNIX
io_unix.t: simplify AF_UNIX check on Windows io_unix.t: make tests run on Windows builds if threads + AF_UNIX
-rw-r--r--dist/IO/t/io_unix.t24
1 files changed, 18 insertions, 6 deletions
diff --git a/dist/IO/t/io_unix.t b/dist/IO/t/io_unix.t
index a6cd05c898..93cddfb7c6 100644
--- a/dist/IO/t/io_unix.t
+++ b/dist/IO/t/io_unix.t
@@ -1,9 +1,16 @@
#!./perl
use Config;
+use IO::Socket;
BEGIN {
my $reason;
+ my $can_fork = $Config{d_fork} ||
+ (($^O eq 'MSWin32' || $^O eq 'NetWare') and
+ $Config{useithreads} and
+ $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
+ );
+
if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bSocket\b/) {
$reason = 'Socket extension unavailable';
}
@@ -11,18 +18,25 @@ BEGIN {
$reason = 'IO extension unavailable';
}
elsif ($^O eq 'os2') {
- require IO::Socket;
-
eval {IO::Socket::pack_sockaddr_un('/foo/bar') || 1}
or $@ !~ /not implemented/ or
$reason = 'compiled without TCP/IP stack v4';
}
- elsif ($^O =~ m/^(?:qnx|nto|vos|MSWin32)$/ ) {
+ elsif ($^O =~ m/^(?:qnx|nto|vos)$/ ) {
$reason = "UNIX domain sockets not implemented on $^O";
}
- elsif (! $Config{'d_fork'}) {
+ elsif (! $can_fork) {
$reason = 'no fork';
}
+ elsif ($^O eq 'MSWin32') {
+ if ($ENV{CONTINUOUS_INTEGRATION}) {
+ $reason = 'Skipping on Windows CI, see gh17575 and gh17429';
+ } else {
+ $reason = "AF_UNIX unavailable or disabled on this platform"
+ unless eval { socket(my $sock, PF_UNIX, SOCK_STREAM, 0) };
+ }
+ }
+
if ($reason) {
print "1..0 # Skip: $reason\n";
exit 0;
@@ -50,8 +64,6 @@ unlink($PATH) or $^O eq 'os2' or die "Can't unlink $PATH: $!";
$| = 1;
print "1..5\n";
-use IO::Socket;
-
$listen = IO::Socket::UNIX->new(Local => $PATH, Listen => 0);
# Sometimes UNIX filesystems are mounted for security reasons