Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[t/spec] made Socket test a bit more robust

git-svn-id: http://svn.pugscode.org/pugs@26673 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 2e0ab17131e945d4272b250b4e8ec312a5fa8f99 1 parent 04afe09
moritz authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 S32-io/IO-Socket-INET.t
View
14 S32-io/IO-Socket-INET.t
@@ -19,6 +19,10 @@ given $*OS {
$netstat_cmd = "netstat -f inet -p tcp -a -n";
$netstat_pat = regex { [ ^^ .+? <dot> (\d+) <.sp> .+? ]+ $ };
}
+ default {
+ skip_rest('Operating system not yet supported');
+ exit 0;
+ }
# TODO: when 'Win32' etc.
}
$received = fake_qx( $netstat_cmd ); # refactor into 1 line after
@@ -28,8 +32,12 @@ if $received ~~ $netstat_pat { @ports = $/[]; } # development complete
# sequentially search for the first unused port
my $port = 1024;
while $port < 65535 && $port==any(@ports) { $port++; }
-if $port > 65535 { die "no free port"; }
-# warn "CHOSEN PORT $port";
+if $port > 65535 {
+ diag "no free port; abortin";
+ skip_rest 'No port free - cannot test';
+ exit 0;
+}
+diag "Testing on port $port";
# test 1 creates a TCP socket but does not use it.
constant PF_INET = 2; # these should move into a file,
@@ -105,3 +113,5 @@ UDP. Unix sockets. Concurrent connections (needs threads).
time L<http://www.ietf.org/rfc/rfc868.txt> port 37
=end pod
+
+# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.