summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/App/Prove/State.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/App/Prove/State.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/App/Prove/State.pm45
1 files changed, 23 insertions, 22 deletions
diff --git a/Master/tlpkg/tlperl/lib/App/Prove/State.pm b/Master/tlpkg/tlperl/lib/App/Prove/State.pm
index 202f7aadd3b..91275b0cddd 100644
--- a/Master/tlpkg/tlperl/lib/App/Prove/State.pm
+++ b/Master/tlpkg/tlperl/lib/App/Prove/State.pm
@@ -26,11 +26,11 @@ App::Prove::State - State storage for the C<prove> command.
=head1 VERSION
-Version 3.17
+Version 3.23
=cut
-$VERSION = '3.17';
+$VERSION = '3.23';
=head1 DESCRIPTION
@@ -59,9 +59,9 @@ Accepts a hashref with the following key/value pairs:
The filename of the data store holding the data that App::Prove::State reads.
-=item * C<extension> (optional)
+=item * C<extensions> (optional)
-The test name extension. Defaults to C<.t>.
+The test name extensions. Defaults to C<.t>.
=item * C<result_class> (optional)
@@ -77,12 +77,11 @@ sub new {
my %args = %{ shift || {} };
my $self = bless {
- select => [],
- seq => 1,
- store => delete $args{store},
- extension => ( delete $args{extension} || '.t' ),
- result_class =>
- ( delete $args{result_class} || 'App::Prove::State::Result' ),
+ select => [],
+ seq => 1,
+ store => delete $args{store},
+ extensions => ( delete $args{extensions} || ['.t'] ),
+ result_class => ( delete $args{result_class} || 'App::Prove::State::Result' ),
}, $class;
$self->{_} = $self->result_class->new(
@@ -105,17 +104,17 @@ identical interface.
=cut
-=head2 C<extension>
+=head2 C<extensions>
-Get or set the extension files must have in order to be considered
-tests. Defaults to '.t'.
+Get or set the list of extensions that files must have in order to be
+considered tests. Defaults to ['.t'].
=cut
-sub extension {
+sub extensions {
my $self = shift;
- $self->{extension} = shift if @_;
- return $self->{extension};
+ $self->{extensions} = shift if @_;
+ return $self->{extensions};
}
=head2 C<results>
@@ -356,7 +355,7 @@ sub _get_raw_tests {
# Do globbing on Win32.
@argv = map { glob "$_" } @argv if NEED_GLOB;
- my $extension = $self->{extension};
+ my $extensions = $self->{extensions};
for my $arg (@argv) {
if ( '-' eq $arg ) {
@@ -368,23 +367,25 @@ sub _get_raw_tests {
push @tests,
sort -d $arg
? $recurse
- ? $self->_expand_dir_recursive( $arg, $extension )
- : glob( File::Spec->catfile( $arg, "*$extension" ) )
+ ? $self->_expand_dir_recursive( $arg, $extensions )
+ : map { glob( File::Spec->catfile( $arg, "*$_" ) ) } @{$extensions}
: $arg;
}
return @tests;
}
sub _expand_dir_recursive {
- my ( $self, $dir, $extension ) = @_;
+ my ( $self, $dir, $extensions ) = @_;
my @tests;
+ my $ext_string = join( '|', map { quotemeta } @{$extensions} );
+
find(
{ follow => 1, #21938
follow_skip => 2,
wanted => sub {
- -f
- && /\Q$extension\E$/
+ -f
+ && /(?:$ext_string)$/
&& push @tests => $File::Find::name;
}
},