This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Porting/bench.pl: --verbose assist on tests failure
authorJim Cromie <jim.cromie@gmail.com>
Sun, 10 Apr 2016 04:33:10 +0000 (22:33 -0600)
committerTony Cook <tony@develop-help.com>
Wed, 15 Jun 2016 00:35:52 +0000 (10:35 +1000)
with --verbose, --tests=foo will fail loudly, so user can pick a test.

Porting/bench.pl

index 94732fe..c5dcdf1 100755 (executable)
@@ -417,7 +417,9 @@ sub filter_tests {
     else {
         my %t;
         for (split /,/, $opt) {
-            die "Error: no such test found: '$_'\n" unless exists $tests->{$_};
+            die "Error: no such test found: '$_'\n"
+                . ($OPTS{verbose} ? "  have: @{[ sort keys %$tests ]}\n" : "")
+                unless exists $tests->{$_};
             $t{$_} = 1;
         }
         for (keys %$tests) {