From: Andy Polyakov <appro@openssl.org>
Date: Fri, 1 Sep 2017 21:13:28 +0000 (+0200)
Subject: test/run_tests.pl: don't use Module::Load::Conditional.
X-Git-Tag: OpenSSL_1_1_1-pre1~696
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26810b5eaffad3fa6d320600d8ea36e2ed86ff7c;p=openssl

test/run_tests.pl: don't use Module::Load::Conditional.

Ironically enough not all installations get Module::Load::Conditional
installed by default... [It's a bit half-hearted, because such
installations are likely to lack more stuffi that is needed, but
nevertheless, it proved to be helpful.]

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4323)
---

diff --git a/test/run_tests.pl b/test/run_tests.pl
index 9f517da3a9..6343ec7bc3 100644
--- a/test/run_tests.pl
+++ b/test/run_tests.pl
@@ -19,10 +19,9 @@ use File::Basename;
 use FindBin;
 use lib "$FindBin::Bin/../util/perl";
 use OpenSSL::Glob;
-use Module::Load::Conditional qw(can_load);
 
-my $TAP_Harness = can_load(modules => { 'TAP::Harness' => undef }) 
-    ? 'TAP::Harness' : 'OpenSSL::TAP::Harness';
+my $TAP_Harness = eval { require TAP::Harness } ? "TAP::Harness"
+                                                : "OpenSSL::TAP::Harness";
 
 my $srctop = $ENV{SRCTOP} || $ENV{TOP};
 my $bldtop = $ENV{BLDTOP} || $ENV{TOP};