summaryrefslogtreecommitdiff
path: root/lib/Net
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-26 17:47:57 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-26 17:47:57 +0000
commita2a978ac74e3f07d5ba28e7a4d1f1e4ae67ce129 (patch)
treea6b49396544e348857ed96ffc36c6cb0b36d4ffb /lib/Net
parentd54344fc28d39ef8e90173262ec572bec67f5e6c (diff)
downloadperl-a2a978ac74e3f07d5ba28e7a4d1f1e4ae67ce129.tar.gz
Net::Ping isn't going to work much without
the Socket extension; fail more gracefully. p4raw-id: //depot/perl@13890
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/Ping/t/100_load.t7
-rw-r--r--lib/Net/Ping/t/110_icmp_inst.t7
-rw-r--r--lib/Net/Ping/t/120_udp_inst.t7
-rw-r--r--lib/Net/Ping/t/130_tcp_inst.t7
-rw-r--r--lib/Net/Ping/t/140_stream_inst.t7
-rw-r--r--lib/Net/Ping/t/200_ping_tcp.t4
-rw-r--r--lib/Net/Ping/t/300_ping_stream.t4
7 files changed, 43 insertions, 0 deletions
diff --git a/lib/Net/Ping/t/100_load.t b/lib/Net/Ping/t/100_load.t
index d6a71e0235..eff67e3fc5 100644
--- a/lib/Net/Ping/t/100_load.t
+++ b/lib/Net/Ping/t/100_load.t
@@ -3,6 +3,13 @@
######################### 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;}
diff --git a/lib/Net/Ping/t/110_icmp_inst.t b/lib/Net/Ping/t/110_icmp_inst.t
index 2e67a5972a..c358dac965 100644
--- a/lib/Net/Ping/t/110_icmp_inst.t
+++ b/lib/Net/Ping/t/110_icmp_inst.t
@@ -1,6 +1,13 @@
# 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;
diff --git a/lib/Net/Ping/t/120_udp_inst.t b/lib/Net/Ping/t/120_udp_inst.t
index ee53bd40bf..e4a39e4ee0 100644
--- a/lib/Net/Ping/t/120_udp_inst.t
+++ b/lib/Net/Ping/t/120_udp_inst.t
@@ -1,6 +1,13 @@
# 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;
diff --git a/lib/Net/Ping/t/130_tcp_inst.t b/lib/Net/Ping/t/130_tcp_inst.t
index 6a547e161e..a7cc1d246c 100644
--- a/lib/Net/Ping/t/130_tcp_inst.t
+++ b/lib/Net/Ping/t/130_tcp_inst.t
@@ -1,5 +1,12 @@
# 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;
diff --git a/lib/Net/Ping/t/140_stream_inst.t b/lib/Net/Ping/t/140_stream_inst.t
index 142f6db74f..db35a88150 100644
--- a/lib/Net/Ping/t/140_stream_inst.t
+++ b/lib/Net/Ping/t/140_stream_inst.t
@@ -1,5 +1,12 @@
# 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;
diff --git a/lib/Net/Ping/t/200_ping_tcp.t b/lib/Net/Ping/t/200_ping_tcp.t
index 7bdc8e7378..f257b0d26e 100644
--- a/lib/Net/Ping/t/200_ping_tcp.t
+++ b/lib/Net/Ping/t/200_ping_tcp.t
@@ -7,6 +7,10 @@ BEGIN {
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.
diff --git a/lib/Net/Ping/t/300_ping_stream.t b/lib/Net/Ping/t/300_ping_stream.t
index 4c32a64f6b..381e08bfb2 100644
--- a/lib/Net/Ping/t/300_ping_stream.t
+++ b/lib/Net/Ping/t/300_ping_stream.t
@@ -7,6 +7,10 @@ BEGIN {
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.