Package: libnet-dns-lite-perl / 0.12-2

no-network-tests.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Description: Skip tests that require network access if not available
Author: Alex Muntada <alexm@alexm.org>
Forwarded: https://github.com/kazuho/p5-Net-DNS-Lite/pull/6
Bug: https://github.com/kazuho/p5-Net-DNS-Lite/pull/6

--- a/t/00base.t
+++ b/t/00base.t
@@ -4,6 +4,9 @@
 use Test::More;
 
 BEGIN {
+    plan skip_all => 'These tests need network access'
+        if $ENV{NO_NETWORK_TESTING};
+
     use_ok('Net::DNS::Lite');
 };
 
--- a/t/02inet_aton.t
+++ b/t/02inet_aton.t
@@ -7,6 +7,9 @@
 use Time::HiRes qw(time);
 
 BEGIN {
+    plan skip_all => 'These tests need network access'
+        if $ENV{NO_NETWORK_TESTING};
+
     if (! -e '/etc/resolv.conf') {
         plan skip_all => 'no /etc/resolv.conf';
     }
--- a/t/03cache.t
+++ b/t/03cache.t
@@ -6,6 +6,9 @@
 use Test::Requires qw(Cache::LRU);
 
 BEGIN {
+    plan skip_all => 'These tests need network access'
+        if $ENV{NO_NETWORK_TESTING};
+
     use_ok('Net::DNS::Lite');
 };
 
--- a/t/05mx.t
+++ b/t/05mx.t
@@ -4,6 +4,9 @@
 use Test::More;
 
 BEGIN {
+    plan skip_all => 'These tests need network access'
+        if $ENV{NO_NETWORK_TESTING};
+
     use_ok('Net::DNS::Lite');
 };
 
--- a/t/01no_response.t
+++ b/t/01no_response.t
@@ -6,6 +6,11 @@
 use Test::More;
 use Time::HiRes qw(time);
 
+BEGIN {
+    plan skip_all => 'These tests need network access'
+        if $ENV{NO_NETWORK_TESTING};
+}
+
 my $r = Net::DNS::Lite->new(
     server => [ qw(google.com) ], # google.com just drops UDP 53 (no response)
 );