OS/2-specific fixes, round II
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / 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 {
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
15use strict;
16use Test::More tests => 9;
17
18use TieOut;
19use MakeMaker::Test::Utils;
20use MakeMaker::Test::Setup::BFD;
21
22use ExtUtils::MakeMaker;
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
bdd9a5d6 39SKIP: {
40 use Config;
41 skip ("installman3dir is null", 1)
42 if !$Config{installman3dir} or
43 $Config{installman3dir} !~ /\S/ or
44 $Config{installman3dir} eq 'none';
58d32538 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}