82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / 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     unshift @INC, 't/lib';
7 }
8
9 use strict;
10 use Test::More tests => 9;
11
12 use File::Spec;
13 use TieOut;
14 use MakeMaker::Test::Utils;
15 use MakeMaker::Test::Setup::BFD;
16
17 use ExtUtils::MakeMaker;
18 use ExtUtils::MakeMaker::Config;
19
20 # Simulate an installation which has man page generation turned off to
21 # ensure these tests will still work.
22 $Config{installman3dir} = 'none';
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 {
40     local $Config{installman3dir} = File::Spec->catdir(qw(t lib));
41
42     my $mm = WriteMakefile(
43         NAME            => 'Big::Dummy',
44         VERSION_FROM    => 'lib/Big/Dummy.pm',
45     );
46
47     ok( keys %{ $mm->{MAN3PODS} } );
48 }
49
50 {
51     my $mm = WriteMakefile(
52         NAME            => 'Big::Dummy',
53         VERSION_FROM    => 'lib/Big/Dummy.pm',
54         INSTALLMAN3DIR  => 'none'
55     );
56
57     is_deeply( $mm->{MAN3PODS}, {} );
58 }
59
60
61 {
62     my $mm = WriteMakefile(
63         NAME            => 'Big::Dummy',
64         VERSION_FROM    => 'lib/Big/Dummy.pm',
65         MAN3PODS        => {}
66     );
67
68     is_deeply( $mm->{MAN3PODS}, { } );
69 }
70
71
72 {
73     my $mm = WriteMakefile(
74         NAME            => 'Big::Dummy',
75         VERSION_FROM    => 'lib/Big/Dummy.pm',
76         MAN3PODS        => { "Foo.pm" => "Foo.1" }
77     );
78
79     is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } );
80 }