View | Details | Raw Unified | Return to bug 8244
Collapse All | Expand All

(-)a/xt/find-undefined-subroutines.pl (-1 / +18 lines)
Lines 61-66 Usage: Link Here
61
    --dest-path|-d PATH     Where you want to build the hierarchy of tests
61
    --dest-path|-d PATH     Where you want to build the hierarchy of tests
62
                            scripts and modules. Leave empty to use a temporary
62
                            scripts and modules. Leave empty to use a temporary
63
                            directory (will be removed automatically)
63
                            directory (will be removed automatically)
64
    --ignore PATTERN        Ignore files with a name matching the specified
65
                            pattern (note that this will only match on a
66
                            single component of a filename so you cannot
67
                            choose to ignore only one of two files with
68
                            identical names)
64
    --verbose|-v            Print some progress informations
69
    --verbose|-v            Print some progress informations
65
    --help|-h               Print this help message
70
    --help|-h               Print this help message
66
71
Lines 76-86 my $src_path; Link Here
76
my $dest_path;
81
my $dest_path;
77
my $verbose = 0;
82
my $verbose = 0;
78
my $help = 0;
83
my $help = 0;
84
my @ignore;
85
my $ignore_regex;
79
86
80
my $options_ok = GetOptions(
87
my $options_ok = GetOptions(
81
    'src-path=s' => \$src_path,
88
    'src-path=s' => \$src_path,
82
    'dest-path=s' => \$dest_path,
89
    'dest-path=s' => \$dest_path,
83
    'verbose' => \$verbose,
90
    'verbose' => \$verbose,
91
    'ignore=s' => \@ignore,
84
    'help' => \$help
92
    'help' => \$help
85
);
93
);
86
94
Lines 89-94 if ($help) { Link Here
89
    exit 0;
97
    exit 0;
90
}
98
}
91
99
100
$ignore_regex = '(';
101
for my $skip (@ignore) {
102
    $ignore_regex .= "$skip|";
103
}
104
chop $ignore_regex;
105
$ignore_regex .= ')';
106
92
if (!$src_path) {
107
if (!$src_path) {
93
    $src_path = $src_path_default;
108
    $src_path = $src_path_default;
94
}
109
}
Lines 133-138 find( sub { Link Here
133
    return $File::Find::prune = 1 if ($_ =~ /^$dest_path$/);
148
    return $File::Find::prune = 1 if ($_ =~ /^$dest_path$/);
134
    return $File::Find::prune = 1 if ($_ =~ /^t$/);
149
    return $File::Find::prune = 1 if ($_ =~ /^t$/);
135
    return $File::Find::prune = 1 if ($_ =~ /^blib$/);
150
    return $File::Find::prune = 1 if ($_ =~ /^blib$/);
151
    return $File::Find::prune = 1 if ($_ =~ /$ignore_regex/);
136
    return unless $_ =~ m/\.pm$/;
152
    return unless $_ =~ m/\.pm$/;
137
    my $file = $File::Find::name;
153
    my $file = $File::Find::name;
138
    $file =~ s#^$src_path##;
154
    $file =~ s#^$src_path##;
Lines 258-263 my @scripts; Link Here
258
find( sub {
274
find( sub {
259
    return $File::Find::prune = 1 if ($_ =~ /^t$/);
275
    return $File::Find::prune = 1 if ($_ =~ /^t$/);
260
    return $File::Find::prune = 1 if ($_ =~ /^$dest_path$/);
276
    return $File::Find::prune = 1 if ($_ =~ /^$dest_path$/);
277
    return $File::Find::prune = 1 if ($_ =~ /$ignore_regex/);
261
    return unless $_ =~ m/\.pl$/;
278
    return unless $_ =~ m/\.pl$/;
262
    my $file = $File::Find::name;
279
    my $file = $File::Find::name;
263
    $file =~ s#^$src_path##;
280
    $file =~ s#^$src_path##;
Lines 389-391 my $includes_param = join(' ', map { "-I$_" } @includedirs); Link Here
389
my $scripts_param = join(' ', map { "$dest_path/$_" } @scripts_to_run);
406
my $scripts_param = join(' ', map { "$dest_path/$_" } @scripts_to_run);
390
407
391
system("prove $includes_param $scripts_param");
408
system("prove $includes_param $scripts_param");
392
- 
409
exit $? >> 8;

Return to bug 8244