提交 53520ebe 编写于 作者: R Richard Levitte

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: NRich Salz <rsalz@openssl.org>
上级 2511c12b
......@@ -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=/ } <FH>)[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(<FH>) {
chomp;
if (/^VERSION=([^\s]*)\s*$/) {
$MINFO_ver = $1;
}
last if /^RELATIVE_DIRECTORY=test$/;
}
while(<FH>) {
......@@ -23,6 +36,9 @@ while(<FH>) {
}
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 =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册