82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / t / build_man.t
CommitLineData
58d32538 1#!/usr/bin/perl -w
2
3# Test if MakeMaker declines to build man pages under the right conditions.
4
5BEGIN {
b78fd716 6 unshift @INC, 't/lib';
58d32538 7}
8
9use strict;
10use Test::More tests => 9;
11
608a105b 12use File::Spec;
58d32538 13use TieOut;
14use MakeMaker::Test::Utils;
15use MakeMaker::Test::Setup::BFD;
16
17use ExtUtils::MakeMaker;
608a105b 18use 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';
58d32538 23
24chdir 't';
25
26perl_lib();
27
28ok( setup_recurs(), 'setup' );
29END {
30 ok( chdir File::Spec->updir );
31 ok( teardown_recurs(), 'teardown' );
32}
33
34ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
35 diag("chdir failed: $!");
36
37ok( my $stdout = tie *STDOUT, 'TieOut' );
38
33b79707 39{
40 local $Config{installman3dir} = File::Spec->catdir(qw(t lib));
41
58d32538 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
5bdf71cc 57 is_deeply( $mm->{MAN3PODS}, {} );
58d32538 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}