Merge pull request #252 from rhansen/inet6
Skip IPv6 tests if IO::Socket::INET6 isn't available
This commit is contained in:
commit
f414493a06
2 changed files with 4 additions and 0 deletions
|
@ -66,6 +66,7 @@ m4_foreach_w([_m], [
|
||||||
HTTP::Message::PSGI
|
HTTP::Message::PSGI
|
||||||
HTTP::Request
|
HTTP::Request
|
||||||
HTTP::Response
|
HTTP::Response
|
||||||
|
IO::Socket::INET6
|
||||||
IO::Socket::IP
|
IO::Socket::IP
|
||||||
Scalar::Util
|
Scalar::Util
|
||||||
Test::MockModule
|
Test::MockModule
|
||||||
|
|
|
@ -3,6 +3,7 @@ eval { require ddclient::Test::Fake::HTTPD; } or plan(skip_all => $@);
|
||||||
SKIP: { eval { require Test::Warnings; } or skip($@, 1); }
|
SKIP: { eval { require Test::Warnings; } or skip($@, 1); }
|
||||||
eval { require 'ddclient'; } or BAIL_OUT($@);
|
eval { require 'ddclient'; } or BAIL_OUT($@);
|
||||||
my $has_http_daemon_ssl = eval { require HTTP::Daemon::SSL; };
|
my $has_http_daemon_ssl = eval { require HTTP::Daemon::SSL; };
|
||||||
|
my $has_io_socket_inet6 = eval { require IO::Socket::INET6; };
|
||||||
my $ipv6_supported = eval {
|
my $ipv6_supported = eval {
|
||||||
require IO::Socket::IP;
|
require IO::Socket::IP;
|
||||||
my $ipv6_socket = IO::Socket::IP->new(
|
my $ipv6_socket = IO::Socket::IP->new(
|
||||||
|
@ -72,6 +73,8 @@ my @test_cases = (
|
||||||
|
|
||||||
for my $tc (@test_cases) {
|
for my $tc (@test_cases) {
|
||||||
SKIP: {
|
SKIP: {
|
||||||
|
skip("IO::Socket::INET6 not available", 1)
|
||||||
|
if ($tc->{ipv6_opt} || $tc->{client_ipv} eq '6') && !$has_io_socket_inet6;
|
||||||
skip("IPv6 not supported on this system", 1)
|
skip("IPv6 not supported on this system", 1)
|
||||||
if $tc->{server_ipv} eq '6' && !$ipv6_supported;
|
if $tc->{server_ipv} eq '6' && !$ipv6_supported;
|
||||||
skip("HTTP::Daemon too old for IPv6 support", 1)
|
skip("HTTP::Daemon too old for IPv6 support", 1)
|
||||||
|
|
Loading…
Reference in a new issue