From: Richard Levitte Date: Sun, 9 Aug 2015 04:52:50 +0000 (+0200) Subject: Check the validity of MINFO X-Git-Tag: OpenSSL_1_1_0-pre1~659 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=53520ebe8757fea7d2e9ffe3d0c610dd6b9b9cc6;p=oweals%2Fopenssl.git Check the validity of MINFO MINFO may be an old file lying around, which might have 00-check_testexes.t produce incorrect results. To make sure this doesn't happen, check the variable VERSION in it against the same variable in the top Makefile. Reviewed-by: Rich Salz --- diff --git a/test/recipes/00-check_testexes.t b/test/recipes/00-check_testexes.t index 483d8830fe..3ab38c77af 100644 --- a/test/recipes/00-check_testexes.t +++ b/test/recipes/00-check_testexes.t @@ -8,13 +8,26 @@ use OpenSSL::Test qw/:DEFAULT top_file/; setup("check_testexes"); +my $OpenSSL_ver = ""; +my $Makefile = top_file("Makefile"); +if (open(FH, $Makefile)) { + $OpenSSL_ver = + (map { chomp; s/^VERSION=([^\s]*)\s*$//; $1 } grep { /^VERSION=/ } )[0]; + close FH; +} + my $MINFO = top_file("MINFO"); plan skip_all => "because MINFO not found. If you want this test to run, please do 'perl util/mkfiles.pl > MINFO'" unless open(FH,$MINFO); +my $MINFO_ver = ""; + while() { chomp; + if (/^VERSION=([^\s]*)\s*$/) { + $MINFO_ver = $1; + } last if /^RELATIVE_DIRECTORY=test$/; } while() { @@ -23,6 +36,9 @@ while() { } close FH; +plan skip_all => "because MINFO is not from this OpenSSL version. If you want this test to run, please do 'perl util/mkfiles.pl > MINFO'" + unless $OpenSSL_ver eq $MINFO_ver; + s/^EXE=\s*//; s/\s*$//; my @expected_tests =