OS/2-specific fixes, round II
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / build_man.t
1 #!/usr/bin/perl -w
2
3 # Test if MakeMaker declines to build man pages under the right conditions.
4
5 BEGIN {
6     if( $ENV{PERL_CORE} ) {
7         chdir 't' if -d 't';
8         @INC = ('../lib', 'lib');
9     }
10     else {
11         unshift @INC, 't/lib';
12     }
13 }
14
15 use strict;
16 use Test::More tests => 9;
17
18 use TieOut;
19 use MakeMaker::Test::Utils;
20 use MakeMaker::Test::Setup::BFD;
21
22 use ExtUtils::MakeMaker;
23
24 chdir 't';
25
26 perl_lib();
27
28 ok( setup_recurs(), 'setup' );
29 END {
30     ok( chdir File::Spec->updir );
31     ok( teardown_recurs(), 'teardown' );
32 }
33
34 ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
35   diag("chdir failed: $!");
36
37 ok( my $stdout = tie *STDOUT, 'TieOut' );
38
39 SKIP: {
40     use Config;
41     skip ("installman3dir is null", 1)
42         if !$Config{installman3dir} or
43             $Config{installman3dir} !~ /\S/ or
44             $Config{installman3dir} eq 'none';
45     my $mm = WriteMakefile(
46         NAME            => 'Big::Dummy',
47         VERSION_FROM    => 'lib/Big/Dummy.pm',
48     );
49
50     ok( keys %{ $mm->{MAN3PODS} } );
51 }
52
53 {
54     my $mm = WriteMakefile(
55         NAME            => 'Big::Dummy',
56         VERSION_FROM    => 'lib/Big/Dummy.pm',
57         INSTALLMAN3DIR  => 'none'
58     );
59
60     ok( !keys %{ $mm->{MAN3PODS} } );
61 }
62
63
64 {
65     my $mm = WriteMakefile(
66         NAME            => 'Big::Dummy',
67         VERSION_FROM    => 'lib/Big/Dummy.pm',
68         MAN3PODS        => {}
69     );
70
71     is_deeply( $mm->{MAN3PODS}, { } );
72 }
73
74
75 {
76     my $mm = WriteMakefile(
77         NAME            => 'Big::Dummy',
78         VERSION_FROM    => 'lib/Big/Dummy.pm',
79         MAN3PODS        => { "Foo.pm" => "Foo.1" }
80     );
81
82     is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } );
83 }