summaryrefslogtreecommitdiffstats
path: root/test/generate_ssl_tests.pl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-06-04 09:39:32 +0100
committerMatt Caswell <matt@openssl.org>2021-06-07 11:02:42 +0100
commit8984b552e74761c30f87b33cd5f0b436a27f8cbc (patch)
tree72561299a7a0db013de6215c4d7c2ff6ee7a0a5b /test/generate_ssl_tests.pl
parentdce7272d08601929a494b9367f4e70163c524cb3 (diff)
Fix generate_ssl_tests.pl
Fix the generate_ssl_tests.pl script so that it can be run standalone from the command line according to the instructions in test/README.ssltest.md Fixes #11430 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15617)
Diffstat (limited to 'test/generate_ssl_tests.pl')
-rw-r--r--test/generate_ssl_tests.pl20
1 files changed, 13 insertions, 7 deletions
diff --git a/test/generate_ssl_tests.pl b/test/generate_ssl_tests.pl
index cdb35cc150..1783d1729e 100644
--- a/test/generate_ssl_tests.pl
+++ b/test/generate_ssl_tests.pl
@@ -11,22 +11,30 @@
use strict;
use warnings;
+use Cwd qw/abs_path/;
use File::Basename;
use File::Spec::Functions;
use OpenSSL::Test qw/srctop_dir srctop_file/;
use OpenSSL::Test::Utils;
-# This block needs to run before 'use lib srctop_dir' directives.
-BEGIN {
- OpenSSL::Test::setup("no_test_here", quiet => 1);
-}
-
use FindBin;
use lib "$FindBin::Bin/../util/perl";
use OpenSSL::fallback "$FindBin::Bin/../external/perl/MODULES.txt";
use Text::Template 1.46;
+my $input_file;
+my $provider;
+
+BEGIN {
+ #Input file may be relative to cwd, but setup below changes the cwd, so
+ #figure out the absolute path first
+ $input_file = abs_path(shift);
+ $provider = shift;
+
+ OpenSSL::Test::setup("no_test_here", quiet => 1);
+}
+
use lib "$FindBin::Bin/ssl-tests";
use vars qw/@ISA/;
@@ -140,8 +148,6 @@ sub read_config {
warn $@ if $@;
}
-my $input_file = shift;
-my $provider = shift;
# Reads the tests into ssltests::tests.
read_config($input_file, $provider);
print_templates();