diff options
author | Richard Levitte <levitte@openssl.org> | 2016-03-05 19:05:25 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-03-07 19:04:28 +0100 |
commit | fa657fc8df1744d1531aba2e269e03d73a12fda9 (patch) | |
tree | f3c4bf1c414f0b762a1b82cf0eb7eb5b342a6b11 /test/testlib | |
parent | db922318b3470db8629979f24d4f0f82e9561190 (diff) |
Make OpenSSL::Test::setup() a bit more forgiving
It was unexpected that OpenSSL::Test::setup() should be called twice
by the same recipe. However, that may happen if a recipe combines
OpenSSL::Test and OpenSSL::Test::Simple, which can be a sensible thing
to do. Therefore, we now allow it.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/testlib')
-rw-r--r-- | test/testlib/OpenSSL/Test.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm index 5139a5e1d7..ecac93f8db 100644 --- a/test/testlib/OpenSSL/Test.pm +++ b/test/testlib/OpenSSL/Test.pm @@ -121,9 +121,15 @@ is defined). =cut sub setup { + my $old_test_name = $test_name; $test_name = shift; BAIL_OUT("setup() must receive a name") unless $test_name; + warn "setup() detected test name change. Innocuous, so we continue...\n" + if $old_test_name && $old_test_name ne $test_name; + + return if $old_test_name; + BAIL_OUT("setup() needs \$TOP or \$SRCTOP and \$BLDTOP to be defined") unless $ENV{TOP} || ($ENV{SRCTOP} && $ENV{BLDTOP}); BAIL_OUT("setup() found both \$TOP and \$SRCTOP or \$BLDTOP...") @@ -131,8 +137,8 @@ sub setup { __env(); - BAIL_OUT("setup() expects the file Configure in the \$TOP directory") - unless -f srctop_file("Configure"); + BAIL_OUT("setup() expects the file Configure in the source top directory") + unless -f srctop_file("Configure"); __cwd($directories{RESULTS}); } |