Commit 204e41ed authored by Richard Levitte's avatar Richard Levitte
Browse files

Tone down the requirements of a test that will go away.



00-check_testexes.t was a way for me to check that I didn't forget a
compiled test app.  The way it worked was to require MINFO to be present.
Considering the need for this test has diminished considerably at this
point, I might as well tone down the requirement, and have it skip the
test (and not fail it) if MINFO isn't present.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 71a4f283
Loading
Loading
Loading
Loading
+48 −39
Original line number Diff line number Diff line
@@ -11,39 +11,48 @@ setup("check_testexes");

my $MINFO = top_file("MINFO");

plan tests => 2;
if (ok(open(FH,$MINFO), "MINFO exists")) {
    subtest 'Finding test scripts for the compiled test binaries' => sub {
	find_tests(\*FH); close FH;
    };
} else {
    diag("Expected to find $MINFO, please run 'make files' in the top directory");
}
 SKIP: {
     my %foundfiles;
     my $numtests = 1;

#-------------
# test script finder
sub find_tests {
    my $fh = shift;
    while(<$fh>) {
     if (open(FH,$MINFO)) {
	 while(<FH>) {
	     chomp;
	     last if /^RELATIVE_DIRECTORY=test$/;
	 }
    while(<$fh>) {
	 while(<FH>) {
	     chomp;
	     last if /^EXE=/;
	 }

	 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/\s*$//;
    my %foundfiles =
	 %foundfiles =
	     map {
		 my $key = $_;
		 s/_?test$//;
		 s/(sha\d+)t/$1/;
	    $key => top_file("test",
			     "recipes/[0-9][0-9]-test_$_.t"); } 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 (keys %foundfiles);
     skip "because $MINFO found. If you want this test to run, please do 'perl util/mkfiles.pl > $MINFO'", 1
	 unless %foundfiles;

     foreach (sort keys %foundfiles) {
	 my @check = glob($foundfiles{$_});