| 1 | #line 1 | ||
| 2 | package Module::Install::AuthorTests; | ||
| 3 | 1 | ▶ | |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use 5.005; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Module::Install::Base; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | use Carp (); | ||
| 8 | |||
| 9 | #line 16 | ||
| 10 | |||
| 11 | use vars qw{$VERSION $ISCORE @ISA}; | ||
| 12 | BEGIN { | ||
| 13 | $VERSION = '0.002'; | ||
| 14 | $ISCORE = 1; | ||
| 15 | @ISA = qw{Module::Install::Base}; | ||
| 16 | } | ||
| 17 | 1 | ▶ | |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 1 | ▶ | #line 42 |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 1 | ||
| 20 | 1 | sub author_tests { | |
| 21 | 1 | my ($self, @dirs) = @_; | |
| 22 | _add_author_tests($self, \@dirs, 0); | ||
| 23 | } | ||
| 24 | |||
| 25 | #line 56 | ||
| 26 | |||
| 27 | sub recursive_author_tests { | ||
| 28 | my ($self, @dirs) = @_; | ||
| 29 | _add_author_tests($self, \@dirs, 1); | ||
| 30 | } | ||
| 31 | |||
| 32 | sub _wanted { | ||
| 33 | my $href = shift; | ||
| 34 | sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 } | ||
| 35 | } | ||
| 36 | |||
| 37 | sub _add_author_tests { | ||
| 38 | my ($self, $dirs, $recurse) = @_; | ||
| 39 | return unless $Module::Install::AUTHOR; | ||
| 40 | |||
| 41 | my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t'; | ||
| 42 | |||
| 43 | 0 | ▶ | # XXX: pick a default, later -- rjbs, 2008-02-24 |
|
Subroutine
author_tests: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 44 | 0 | my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests"; | |
| 45 | 0 | @dirs = grep { -d } @dirs; | |
| 46 | |||
| 47 | if ($recurse) { | ||
| 48 | require File::Find; | ||
| 49 | my %test_dir; | ||
| 50 | File::Find::find(_wanted(\%test_dir), @dirs); | ||
| 51 | $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir ); | ||
| 52 | } else { | ||
| 53 | $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs ); | ||
| 54 | } | ||
| 55 | } | ||
| 56 | |||
| 57 | 0 | ▶ | #line 107 |
|
Subroutine
recursive_author_tests: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 58 | 0 | ||
| 59 | 0 | 1; | |