From b8ee3705713f53352966630c85d06f491c03c480 Mon Sep 17 00:00:00 2001 From: christian fafard Date: Mon, 12 Oct 2015 09:50:18 +0200 Subject: [PATCH] Skip HTTPS perl tests if IO::Socket::SSL not installed * tests/Test-proxied-https-auth-keepalive.px: Skip test if perl module IO::Socket::SSL is not installed (trivial change). * tests/Test-proxied-https-auth.px: Skip test if perl module IO::Socket::SSL is not installed (trivial change). --- tests/Test-proxied-https-auth-keepalive.px | 9 ++++++++- tests/Test-proxied-https-auth.px | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/Test-proxied-https-auth-keepalive.px b/tests/Test-proxied-https-auth-keepalive.px index e407f315..929a31ce 100755 --- a/tests/Test-proxied-https-auth-keepalive.px +++ b/tests/Test-proxied-https-auth-keepalive.px @@ -29,7 +29,14 @@ if (defined $srcdir) { use HTTP::Daemon; use HTTP::Request; -use IO::Socket::SSL; +# Skip this test rather than fail it when the module isn't installed +if (!eval {require IO::Socket::SSL;1;}) { + print STDERR "This test needs the perl module \"IO::Socket::SSL\".\n"; + print STDERR "Install e.g. on Debian with 'apt-get install libio-socket-ssl-perl'\n"; + print STDERR " or if using cpanminus 'cpanm IO::Socket::SSL' could be used to install it.\n"; + exit 77; # skip +} +IO::Socket::SSL->import(); my $SOCKET = HTTP::Daemon->new (LocalAddr => 'localhost', ReuseAddr => 1) or die "Cannot create server!!!"; diff --git a/tests/Test-proxied-https-auth.px b/tests/Test-proxied-https-auth.px index 1daefe83..ce6d7ffe 100755 --- a/tests/Test-proxied-https-auth.px +++ b/tests/Test-proxied-https-auth.px @@ -29,7 +29,14 @@ if (defined $srcdir) { use HTTP::Daemon; use HTTP::Request; -use IO::Socket::SSL; +# Skip this test rather than fail it when the module isn't installed +if (!eval {require IO::Socket::SSL;1;}) { + print STDERR "This test needs the perl module \"IO::Socket::SSL\".\n"; + print STDERR "Install e.g. on Debian with 'apt-get install libio-socket-ssl-perl'\n"; + print STDERR " or if using cpanminus 'cpanm IO::Socket::SSL' could be used to install it.\n"; + exit 77; # skip +} +IO::Socket::SSL->import(); my $SOCKET = HTTP::Daemon->new (LocalAddr => 'localhost', ReuseAddr => 1) or die "Cannot create server!!!";