Consolidate the locations where we have our internal perl modules
authorRichard Levitte <levitte@openssl.org>
Fri, 3 Nov 2017 20:43:07 +0000 (21:43 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 5 Nov 2017 21:58:10 +0000 (22:58 +0100)
Instead of having perl modules under test/testlib and util,
consolidate them all to be inside util/perl.

(this is an adaptation of the part of #4069 that wasn't included in #4666)

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4667)

20 files changed:
Configure
test/generate_ssl_tests.pl
test/recipes/80-test_ssl_new.t
test/recipes/tconversion.pl
test/run_tests.pl
util/dofile.pl
util/mkdef.pl
util/perl/OpenSSL/Glob.pm [moved from util/OpenSSL/Glob.pm with 100% similarity]
util/perl/OpenSSL/Test.pm [moved from test/testlib/OpenSSL/Test.pm with 100% similarity]
util/perl/OpenSSL/Test/Simple.pm [moved from test/testlib/OpenSSL/Test/Simple.pm with 100% similarity]
util/perl/OpenSSL/Test/Utils.pm [moved from test/testlib/OpenSSL/Test/Utils.pm with 100% similarity]
util/perl/TLSProxy/ClientHello.pm [moved from util/TLSProxy/ClientHello.pm with 100% similarity]
util/perl/TLSProxy/Message.pm [moved from util/TLSProxy/Message.pm with 100% similarity]
util/perl/TLSProxy/NewSessionTicket.pm [moved from util/TLSProxy/NewSessionTicket.pm with 100% similarity]
util/perl/TLSProxy/Proxy.pm [moved from util/TLSProxy/Proxy.pm with 100% similarity]
util/perl/TLSProxy/Record.pm [moved from util/TLSProxy/Record.pm with 100% similarity]
util/perl/TLSProxy/ServerHello.pm [moved from util/TLSProxy/ServerHello.pm with 100% similarity]
util/perl/TLSProxy/ServerKeyExchange.pm [moved from util/TLSProxy/ServerKeyExchange.pm with 100% similarity]
util/perl/with_fallback.pm [moved from util/with_fallback.pm with 83% similarity]
util/process_docs.pl

index 5b235fe39e0db23580b08759e84715e00aa215d7..3d4b2cd3472dc8edae5634004266b6f135a3401e 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -12,7 +12,7 @@
 use 5.10.0;
 use strict;
 use FindBin;
-use lib "$FindBin::Bin/util";
+use lib "$FindBin::Bin/util/perl";
 use File::Basename;
 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
 use File::Path qw/mkpath/;
@@ -1481,7 +1481,7 @@ if ($builder eq "unified") {
         my $template =
             Text::Template->new(TYPE => 'FILE',
                                 SOURCE => catfile($sourced, $f),
-                                PREPEND => qq{use lib "$FindBin::Bin/util";});
+                                PREPEND => qq{use lib "$FindBin::Bin/util/perl";});
         die "Something went wrong with $sourced/$f: $!\n" unless $template;
         my @text =
             split /^/m,
index fd785b7bc687bc1c8ff987fec8669db54c14cadf..47a328c80dd2e5822291a0db4ac6785919d5dd5b 100644 (file)
@@ -22,7 +22,7 @@ BEGIN {
     OpenSSL::Test::setup("no_test_here");
 }
 
-use lib srctop_dir("util");  # for with_fallback
+use lib srctop_dir("util", "perl");  # for with_fallback
 use lib srctop_dir("test", "ssl-tests");  # for ssltests_base
 
 use with_fallback qw(Text::Template);
index 6f22a5aa35c30178ac6012f54706453aaff80f4f..287defe5c780564f1564bb353ca9e06eadad05ed 100644 (file)
@@ -101,7 +101,7 @@ sub test_conf {
 
       skip 'failure', 2 unless
         ok(run(perltest(["generate_ssl_tests.pl", $input_file],
-                        interpreter_args => [ "-I", srctop_dir("test", "testlib")],
+                        interpreter_args => [ "-I", srctop_dir("util", "perl")],
                         stdout => $tmp_file)),
            "Getting output from generate_ssl_tests.pl.");
 
index e471160619434af97e31349bf26e64a72a6bc809..1cf68dc09b8b288522c473cbbbdad20a703c1b83 100644 (file)
@@ -12,7 +12,6 @@ use warnings;
 
 use File::Compare qw/compare_text/;
 use File::Copy;
-use lib 'testlib';
 use OpenSSL::Test qw/:DEFAULT/;
 
 my %conversionforms = (
index 1859e605b44965ed15151c4d65e84fd8462be131..77dffb332b39c8c225dcf161ca81fb9e9a571e44 100644 (file)
@@ -17,7 +17,7 @@ BEGIN {
 use File::Spec::Functions qw/catdir catfile curdir abs2rel rel2abs/;
 use File::Basename;
 use FindBin;
-use lib "$FindBin::Bin/../util";
+use lib "$FindBin::Bin/../util/perl";
 use OpenSSL::Glob;
 use Module::Load::Conditional qw(can_load);
 
@@ -27,12 +27,11 @@ my $TAP_Harness = can_load(modules => { 'TAP::Harness' => undef })
 my $srctop = $ENV{SRCTOP} || $ENV{TOP};
 my $bldtop = $ENV{BLDTOP} || $ENV{TOP};
 my $recipesdir = catdir($srctop, "test", "recipes");
-my $testlib = catdir($srctop, "test", "testlib");
-my $utillib = catdir($srctop, "util");
+my $libdir = rel2abs(catdir($srctop, "util", "perl"));
 
 my %tapargs =
     ( verbosity => $ENV{VERBOSE} || $ENV{V} || $ENV{HARNESS_VERBOSE} ? 1 : 0,
-      lib       => [ $testlib, $utillib ],
+      lib       => [ $libdir ],
       switches  => '-w',
       merge     => 1
     );
index 8b0c7b41c0667749aa9030252225886ff303210b..f561e6f9a89feb40b8889f3124b5d6a99ba32948 100644 (file)
@@ -14,6 +14,7 @@
 use strict;
 use warnings;
 
+use FindBin;
 use Getopt::Std;
 
 # We actually expect to get the following hash tables from configdata:
@@ -38,7 +39,7 @@ package OpenSSL::Template;
 # a fallback in case it's not installed on the system
 use File::Basename;
 use File::Spec::Functions;
-use lib catdir(dirname(__FILE__));
+use lib "$FindBin::Bin/perl";
 use with_fallback qw(Text::Template);
 
 #use parent qw/Text::Template/;
@@ -175,7 +176,10 @@ my $text =
 # Load the full template (combination of files) into Text::Template
 # and fill it up with our data.  Output goes directly to STDOUT
 
-my $template = OpenSSL::Template->new(TYPE => 'STRING', SOURCE => $text );
+my $template =
+    OpenSSL::Template->new(TYPE => 'STRING',
+                           SOURCE => $text,
+                           PREPEND => qq{use lib "$FindBin::Bin/perl";});
 
 sub output_reset_on {
     $template->output_reset_on();
index ce969db283e3f411ef54223885c54472b83e12c0..779503ce372e26a6e304c842b0e63381d86f4b3e 100755 (executable)
@@ -50,7 +50,7 @@ use configdata;
 use File::Spec::Functions;
 use File::Basename;
 use FindBin;
-use lib "$FindBin::Bin";
+use lib "$FindBin::Bin/perl";
 use OpenSSL::Glob;
 
 my $debug=0;
similarity index 83%
rename from util/with_fallback.pm
rename to util/perl/with_fallback.pm
index b6deb2092e967439524fcfb6a5519db31e91c9d8..2af1d5fbd50d08fd5c77f9fb2308cb2f835a214e 100644 (file)
@@ -13,7 +13,8 @@ sub import {
     foreach (@_) {
        eval "require $_";
        if ($@) {
-           unshift @INC, catdir(dirname(__FILE__), "..", "external", "perl");
+           unshift @INC, catdir(dirname(__FILE__),
+                                 "..", "..", "external", "perl");
            my $transfer = "transfer::$_";
            eval "require $transfer";
            shift @INC;
index 38c2f3f21972138a3aa7e09e35d32cb3ff3bbfaf..e084df78a571deba04b3c4d19e7ef6a14db46d2b 100755 (executable)
@@ -14,7 +14,7 @@ use File::Basename;
 use File::Copy;
 use File::Path;
 use FindBin;
-use lib "$FindBin::Bin";
+use lib "$FindBin::Bin/perl";
 use OpenSSL::Glob;
 use Getopt::Long;
 use Pod::Usage;