diff options
author | Richard Levitte <levitte@openssl.org> | 2015-09-15 14:07:10 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-09-15 14:07:10 +0200 |
commit | 1780e6d916d83f812ffceec56ac3d8fa97b83248 (patch) | |
tree | a6fadf5afafdee48feff662c38e56f9752c5b17b /test/run_tests.pl | |
parent | 187bad4c241ad2a929745546fd473f0692879fa7 (diff) |
Add a method to list available tests
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'test/run_tests.pl')
-rw-r--r-- | test/run_tests.pl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/run_tests.pl b/test/run_tests.pl index 7e61282f16..cacbc02b11 100644 --- a/test/run_tests.pl +++ b/test/run_tests.pl @@ -26,7 +26,8 @@ my @tests = ( "alltests" ); if (@ARGV) { @tests = @ARGV; } -if (grep /^alltests$/, @tests) { +my $list_mode = scalar(grep /^list$/, @tests) != 0; +if (grep /^alltests|list$/, @tests) { @tests = grep { basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/ } glob(catfile($recipesdir,"*.t")); @@ -40,6 +41,12 @@ if (grep /^alltests$/, @tests) { @tests = @t; } -@tests = map { abs2rel($_, rel2abs(curdir())); } @tests; +if ($list_mode) { + @tests = map { $_ = basename($_); $_ =~ s/^[0-9][0-9]-//; $_ =~ s/\.t$//; + $_ } @tests; + print join("\n", @tests), "\n"; +} else { + @tests = map { abs2rel($_, rel2abs(curdir())); } @tests; -runtests(sort @tests); + runtests(sort @tests); +} |