Rework 00-test_checkexes.t for VMS
Unfortunately, a file spec with character range globs interfere with paths on VMS, and are therefore disabled. Rework this test to collect a list of expected tests and a list of all recipes and compare the two using grep. Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
f5098edb14
commit
8368d46bca
@ -3,6 +3,7 @@
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
use File::Spec::Functions;
|
use File::Spec::Functions;
|
||||||
|
use File::Basename;
|
||||||
use OpenSSL::Test qw/:DEFAULT top_file/;
|
use OpenSSL::Test qw/:DEFAULT top_file/;
|
||||||
|
|
||||||
setup("check_testexes");
|
setup("check_testexes");
|
||||||
@ -10,10 +11,9 @@ setup("check_testexes");
|
|||||||
my $MINFO = top_file("MINFO");
|
my $MINFO = top_file("MINFO");
|
||||||
|
|
||||||
SKIP: {
|
SKIP: {
|
||||||
my %foundfiles;
|
skip "because $MINFO not found. If you want this test to run, please do 'perl util/mkfiles.pl > $MINFO'"
|
||||||
my $numtests = 1;
|
unless open(FH,$MINFO);
|
||||||
|
|
||||||
if (open(FH,$MINFO)) {
|
|
||||||
while(<FH>) {
|
while(<FH>) {
|
||||||
chomp;
|
chomp;
|
||||||
last if /^RELATIVE_DIRECTORY=test$/;
|
last if /^RELATIVE_DIRECTORY=test$/;
|
||||||
@ -24,37 +24,22 @@ my $MINFO = top_file("MINFO");
|
|||||||
}
|
}
|
||||||
close FH;
|
close FH;
|
||||||
|
|
||||||
my $pathfix = sub { return shift; }; # noop
|
|
||||||
if ($^O eq "MSWin32") {
|
|
||||||
# Experience has shown that glob needs the backslashes escaped
|
|
||||||
# to handle the glob glob() gets served. Otherwise, it sometimes
|
|
||||||
# considers the backslash an escape of the next character, most
|
|
||||||
# notably the [.
|
|
||||||
# (if the single backslash is followed by a *, however, the *
|
|
||||||
# doesn't seem to be considered escaped... go figure...)
|
|
||||||
$pathfix = sub { shift; s/\\/\\\\/g; return $_; };
|
|
||||||
}
|
|
||||||
s/^EXE=\s*//;
|
s/^EXE=\s*//;
|
||||||
s/\s*$//;
|
s/\s*$//;
|
||||||
%foundfiles =
|
my @expected_tests =
|
||||||
map {
|
map { s/\..*$//; # Remove extension
|
||||||
my $key = $_;
|
s/_?test$//; # Remove possible underscore
|
||||||
s/_?test$//;
|
s/(sha\d+)t/$1/; # sha comes with no t at the end
|
||||||
s/(sha\d+)t/$1/;
|
$_; } split(/\s+/, $_);
|
||||||
$key =>
|
|
||||||
$pathfix->(top_file("test", "recipes",
|
|
||||||
"[0-9][0-9]-test_$_.t")); } split(/\s+/, $_);
|
|
||||||
$numtests = scalar keys %foundfiles;
|
|
||||||
}
|
|
||||||
|
|
||||||
plan tests => $numtests;
|
plan tests => scalar @expected_tests;
|
||||||
|
|
||||||
skip "because $MINFO not found. If you want this test to run, please do 'perl util/mkfiles.pl > $MINFO'", 1
|
my @found_tests =
|
||||||
unless %foundfiles;
|
map { basename($_) } glob(top_file("test", "recipes", "*.t"));
|
||||||
|
|
||||||
foreach (sort keys %foundfiles) {
|
foreach my $test (sort @expected_tests) {
|
||||||
my @check = glob($foundfiles{$_});
|
ok(scalar(grep(/^[0-9][0-9]-test_$test\.t$/, @found_tests)),
|
||||||
ok(scalar @check, "check that a test for $_ exists")
|
"check that a test for $test exists")
|
||||||
|| diag("Expected to find something matching $foundfiles{$_}");
|
|| diag("Expected to find something matching '[0-9][0-9]-test_$test.t'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user