This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make setpgrpstack.t use skip_all_without_config
[perl5.git] / t / porting / dual-life.t
CommitLineData
ef9dbfd8 1#!/perl -w
52143fbb 2use 5.010;
ef9dbfd8
DG
3use strict;
4
5# This tests properties of dual-life modules:
6#
7# * Are all dual-life programs being generated in utils/?
8
5e515724
DG
9require './test.pl';
10
11plan('no_plan');
12
ef9dbfd8
DG
13use File::Basename;
14use File::Find;
15use File::Spec::Functions;
ef9dbfd8 16
52143fbb
DG
17# Exceptions are found in dual-life bin dirs but aren't
18# installed by default
cde5101a 19my @not_installed = qw(
52143fbb
DG
20 ../cpan/Encode/bin/ucm2table
21 ../cpan/Encode/bin/ucmlint
22 ../cpan/Encode/bin/ucmsort
23 ../cpan/Encode/bin/unidump
24);
25
cde5101a
NC
26my %dist_dir_exe;
27
28foreach (qw (podchecker podselect pod2usage)) {
29 $dist_dir_exe{lc "$_.PL"} = "../cpan/Pod-Parser/$_";
30};
bab7aada 31foreach (qw (pod2man pod2text)) {
2419ffa9 32 $dist_dir_exe{lc "$_.PL"} = "../cpan/podlators/$_";
bab7aada 33};
33c64ab2 34$dist_dir_exe{'pod2html.pl'} = '../ext/Pod-Html';
cde5101a 35
ef9dbfd8
DG
36my @programs;
37
38find(
39 sub {
40 my $name = $File::Find::name;
41 return if $name =~ /blib/;
42 return unless $name =~ m{/(?:bin|scripts?)/\S+\z};
43
44 push @programs, $name;
52143fbb 45 },
ef9dbfd8
DG
46 qw( ../cpan ../dist ../ext ),
47);
48
cde5101a
NC
49my $ext = $^O eq 'VMS' ? '.com' : '';
50
ef9dbfd8 51for my $f ( @programs ) {
01604df2 52 $f =~ s/\.\z// if $^O eq 'VMS';
cde5101a 53 next if qr/(?i:$f)/ ~~ @not_installed;
01604df2 54 $f = basename($f);
cde5101a
NC
55 if(qr/\A(?i:$f)\z/ ~~ %dist_dir_exe) {
56 ok( -f "$dist_dir_exe{lc $f}$ext", "$f$ext");
57 } else {
58 ok( -f catfile('..', 'utils', "$f$ext"), "$f$ext" );
59 }
ef9dbfd8
DG
60}
61