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 <rsalz@openssl.org>
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>) {
}
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 =