From: Matt Caswell Date: Fri, 4 Jun 2021 08:39:32 +0000 (+0100) Subject: Fix generate_ssl_tests.pl X-Git-Tag: openssl-3.0.0-beta1~178 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8984b552e74761c30f87b33cd5f0b436a27f8cbc;p=thirdparty%2Fopenssl.git 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 (Merged from https://github.com/openssl/openssl/pull/15617) --- 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();