5 # This tests properties of dual-life modules:
7 # * Are all dual-life programs being generated in utils/?
15 use File::Spec::Functions;
17 # Exceptions that are found in dual-life bin dirs but aren't
18 # installed by default; some occur only during testing:
19 my $not_installed = qr{^(?:
20 \.\./cpan/Encode/bin/u(?:cm(?:2table|lint|sort)|nidump)
22 \.\./cpan/Module-Build/MB-[\w\d]+/Simple/bin/foo(?:\.PL)?
27 foreach (qw (podchecker podselect pod2usage)) {
28 $dist_dir_exe{lc "$_.PL"} = "../cpan/Pod-Parser/$_";
30 foreach (qw (pod2man pod2text)) {
31 $dist_dir_exe{lc "$_.PL"} = "../cpan/podlators/$_";
33 $dist_dir_exe{'pod2html.pl'} = '../ext/Pod-Html';
39 my $name = $File::Find::name;
40 return if $name =~ /blib/;
41 return unless $name =~ m{/(?:bin|scripts?)/\S+\z} && $name !~ m{/t/};
43 push @programs, $name;
45 qw( ../cpan ../dist ../ext ),
48 my $ext = $^O eq 'VMS' ? '.com' : '';
50 for my $f ( @programs ) {
51 $f =~ s/\.\z// if $^O eq 'VMS';
52 next if $f =~ $not_installed;
53 my $bn = basename($f);
54 if(qr/\A(?i:$bn)\z/ ~~ %dist_dir_exe) {
55 ok( -f "$dist_dir_exe{lc $bn}$ext", "$f$ext");
57 ok( -f catfile('..', 'utils', "$bn$ext"), "$f$ext" );