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' );
47 skip ("installman3dir is null", 1)
48 if !$Config{installman3dir} or
49 $Config{installman3dir} !~ /\S/ or
50 $Config{installman3dir} eq 'none';
51 my $mm = WriteMakefile(
53 VERSION_FROM => 'lib/Big/Dummy.pm',
56 ok( keys %{ $mm->{MAN3PODS} } );
60 local $Config{installman3dir} = File::Spec->catdir(qw(t lib));
62 my $mm = WriteMakefile(
64 VERSION_FROM => 'lib/Big/Dummy.pm',
65 INSTALLMAN3DIR => 'none'
68 ok( !keys %{ $mm->{MAN3PODS} } );
73 my $mm = WriteMakefile(
75 VERSION_FROM => 'lib/Big/Dummy.pm',
79 is_deeply( $mm->{MAN3PODS}, { } );
84 my $mm = WriteMakefile(
86 VERSION_FROM => 'lib/Big/Dummy.pm',
87 MAN3PODS => { "Foo.pm" => "Foo.1" }
90 is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } );