3 # Test if MakeMaker declines to build man pages under the right conditions.
6 if( $ENV{PERL_CORE} ) {
8 @INC = ('../lib', 'lib');
11 unshift @INC, 't/lib';
16 use Test::More tests => 9;
20 use MakeMaker::Test::Utils;
21 use MakeMaker::Test::Setup::BFD;
23 use ExtUtils::MakeMaker;
24 use ExtUtils::MakeMaker::Config;
26 # Simulate an installation which has man page generation turned off to
27 # ensure these tests will still work.
28 $Config{installman3dir} = 'none';
34 ok( setup_recurs(), 'setup' );
36 ok( chdir File::Spec->updir );
37 ok( teardown_recurs(), 'teardown' );
40 ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
41 diag("chdir failed: $!");
43 ok( my $stdout = tie *STDOUT, 'TieOut' );
46 skip ("installman3dir is null", 1)
47 if !$Config{installman3dir} or
48 $Config{installman3dir} !~ /\S/ or
49 $Config{installman3dir} eq 'none';
50 my $mm = WriteMakefile(
52 VERSION_FROM => 'lib/Big/Dummy.pm',
55 ok( keys %{ $mm->{MAN3PODS} } );
59 local $Config{installman3dir} = File::Spec->catdir(qw(t lib));
61 my $mm = WriteMakefile(
63 VERSION_FROM => 'lib/Big/Dummy.pm',
64 INSTALLMAN3DIR => 'none'
67 ok( !keys %{ $mm->{MAN3PODS} } );
72 my $mm = WriteMakefile(
74 VERSION_FROM => 'lib/Big/Dummy.pm',
78 is_deeply( $mm->{MAN3PODS}, { } );
83 my $mm = WriteMakefile(
85 VERSION_FROM => 'lib/Big/Dummy.pm',
86 MAN3PODS => { "Foo.pm" => "Foo.1" }
89 is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } );