the Socket extension; fail more gracefully.
p4raw-id: //depot/perl@13890
######################### We start with some black magic to print on failure.
+BEGIN {
+ unless (eval "require Socket") {
+ print "1..0 # Skip: no Socket\n";
+ exit;
+ }
+}
+
use Test;
BEGIN { plan tests => 1; $loaded = 0}
END { ok $loaded;}
# Test to make sure object can be instantiated for icmp protocol.
# Root access is required to actually perform icmp testing.
+BEGIN {
+ unless (eval "require Socket") {
+ print "1..0 # Skip: no Socket\n";
+ exit;
+ }
+}
+
use Test;
use Net::Ping;
plan tests => 2;
# Test to make sure object can be instantiated for udp protocol.
# I do not know of any servers that support udp echo anymore.
+BEGIN {
+ unless (eval "require Socket") {
+ print "1..0 # Skip: no Socket\n";
+ exit;
+ }
+}
+
use Test;
use Net::Ping;
plan tests => 2;
# Test to make sure object can be instantiated for tcp protocol.
+BEGIN {
+ unless (eval "require Socket") {
+ print "1..0 # Skip: no Socket\n";
+ exit;
+ }
+}
+
use Test;
use Net::Ping;
plan tests => 2;
# Test to make sure object can be instantiated for stream protocol.
+BEGIN {
+ unless (eval "require Socket") {
+ print "1..0 # Skip: no Socket\n";
+ exit;
+ }
+}
+
use Test;
use Net::Ping;
plan tests => 2;
chdir 't' if -d 't';
@INC = qw(../lib);
}
+ unless (eval "require Socket") {
+ print "1..0 # Skip: no Socket\n";
+ exit;
+ }
}
# Remote network test using tcp protocol.
chdir 't' if -d 't';
@INC = qw(../lib);
}
+ unless (eval "require Socket") {
+ print "1..0 # Skip: no Socket\n";
+ exit;
+ }
}
# Test of stream protocol using loopback interface.