diff options
author | Richard Levitte <levitte@openssl.org> | 2015-08-09 05:35:57 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-09-07 16:10:58 +0200 |
commit | 2511c12bf2d5f07f329d1e90cde8791817e4357e (patch) | |
tree | 3a06b29ca064cc5c7e05bf5dbbf5cb367d904a9f /test | |
parent | 8de4f3d3a63f5eb5afa4bd92043953b501d0d7eb (diff) | |
download | openssl-2511c12bf2d5f07f329d1e90cde8791817e4357e.zip openssl-2511c12bf2d5f07f329d1e90cde8791817e4357e.tar.gz openssl-2511c12bf2d5f07f329d1e90cde8791817e4357e.tar.bz2 |
Better method of skipping all the tests in 00-check_testexes.t
Before trying to read MINFO, we have no idea how many to test for, and
because skip expects to get an exact number somehow, it's better to
use 'plan skip_all'.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/recipes/00-check_testexes.t | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/test/recipes/00-check_testexes.t b/test/recipes/00-check_testexes.t index aa7281a..483d883 100644 --- a/test/recipes/00-check_testexes.t +++ b/test/recipes/00-check_testexes.t @@ -10,36 +10,34 @@ setup("check_testexes"); my $MINFO = top_file("MINFO"); - SKIP: { - skip "because $MINFO not found. If you want this test to run, please do 'perl util/mkfiles.pl > $MINFO'" - unless open(FH,$MINFO); - - while(<FH>) { - chomp; - last if /^RELATIVE_DIRECTORY=test$/; - } - while(<FH>) { - chomp; - last if /^EXE=/; - } - close FH; - - s/^EXE=\s*//; - s/\s*$//; - my @expected_tests = - map { s/\..*$//; # Remove extension - s/_?test$//; # Remove possible underscore - s/(sha\d+)t/$1/; # sha comes with no t at the end - $_; } split(/\s+/, $_); - - plan tests => scalar @expected_tests; - - my @found_tests = - map { basename($_) } glob(top_file("test", "recipes", "*.t")); - - foreach my $test (sort @expected_tests) { - ok(scalar(grep(/^[0-9][0-9]-test_$test\.t$/, @found_tests)), - "check that a test for $test exists") - || diag("Expected to find something matching '[0-9][0-9]-test_$test.t'"); - } +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); + +while(<FH>) { + chomp; + last if /^RELATIVE_DIRECTORY=test$/; +} +while(<FH>) { + chomp; + last if /^EXE=/; +} +close FH; + +s/^EXE=\s*//; +s/\s*$//; +my @expected_tests = + map { s/\..*$//; # Remove extension + s/_?test$//; # Remove 'test', possibly prefixed with '_' + s/(sha\d+)t/$1/; # sha comes with no t at the end + $_; } split(/\s+/, $_); + +plan tests => scalar @expected_tests; + +my @found_tests = + map { basename($_) } glob(top_file("test", "recipes", "*.t")); + +foreach my $test (sort @expected_tests) { + ok(scalar(grep(/^[0-9][0-9]-test_$test\.t$/, @found_tests)), + "check that a test for $test exists") + || diag("Expected to find something matching '[0-9][0-9]-test_$test.t'"); } |