@@ -, +, @@ ignore certain files. returns --- xt/find-undefined-subroutines.pl | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) --- a/xt/find-undefined-subroutines.pl +++ a/xt/find-undefined-subroutines.pl @@ -61,6 +61,11 @@ Usage: --dest-path|-d PATH Where you want to build the hierarchy of tests scripts and modules. Leave empty to use a temporary directory (will be removed automatically) + --ignore PATTERN Ignore files with a name matching the specified + pattern (note that this will only match on a + single component of a filename so you cannot + choose to ignore only one of two files with + identical names) --verbose|-v Print some progress informations --help|-h Print this help message @@ -76,11 +81,14 @@ my $src_path; my $dest_path; my $verbose = 0; my $help = 0; +my @ignore; +my $ignore_regex; my $options_ok = GetOptions( 'src-path=s' => \$src_path, 'dest-path=s' => \$dest_path, 'verbose' => \$verbose, + 'ignore=s' => \@ignore, 'help' => \$help ); @@ -89,6 +97,13 @@ if ($help) { exit 0; } +$ignore_regex = '('; +for my $skip (@ignore) { + $ignore_regex .= "$skip|"; +} +chop $ignore_regex; +$ignore_regex .= ')'; + if (!$src_path) { $src_path = $src_path_default; } @@ -133,6 +148,7 @@ find( sub { return $File::Find::prune = 1 if ($_ =~ /^$dest_path$/); return $File::Find::prune = 1 if ($_ =~ /^t$/); return $File::Find::prune = 1 if ($_ =~ /^blib$/); + return $File::Find::prune = 1 if ($_ =~ /$ignore_regex/); return unless $_ =~ m/\.pm$/; my $file = $File::Find::name; $file =~ s#^$src_path##; @@ -258,6 +274,7 @@ my @scripts; find( sub { return $File::Find::prune = 1 if ($_ =~ /^t$/); return $File::Find::prune = 1 if ($_ =~ /^$dest_path$/); + return $File::Find::prune = 1 if ($_ =~ /$ignore_regex/); return unless $_ =~ m/\.pl$/; my $file = $File::Find::name; $file =~ s#^$src_path##; @@ -389,3 +406,4 @@ my $includes_param = join(' ', map { "-I$_" } @includedirs); my $scripts_param = join(' ', map { "$dest_path/$_" } @scripts_to_run); system("prove $includes_param $scripts_param"); +exit $? >> 8; --