build_man.t

来自「source of perl for linux application,」· T 代码 · 共 87 行

T
87
字号
#!/usr/bin/perl -w# Test if MakeMaker declines to build man pages under the right conditions.BEGIN {    if( $ENV{PERL_CORE} ) {        chdir 't' if -d 't';        @INC = ('../lib', 'lib');    }    else {        unshift @INC, 't/lib';    }}use strict;use Test::More tests => 9;use File::Spec;use TieOut;use MakeMaker::Test::Utils;use MakeMaker::Test::Setup::BFD;use ExtUtils::MakeMaker;use ExtUtils::MakeMaker::Config;# Simulate an installation which has man page generation turned off to# ensure these tests will still work.$Config{installman3dir} = 'none';chdir 't';perl_lib();ok( setup_recurs(), 'setup' );END {    ok( chdir File::Spec->updir );    ok( teardown_recurs(), 'teardown' );}ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||  diag("chdir failed: $!");ok( my $stdout = tie *STDOUT, 'TieOut' );{    local $Config{installman3dir} = File::Spec->catdir(qw(t lib));    my $mm = WriteMakefile(        NAME            => 'Big::Dummy',        VERSION_FROM    => 'lib/Big/Dummy.pm',    );    ok( keys %{ $mm->{MAN3PODS} } );}{    my $mm = WriteMakefile(        NAME            => 'Big::Dummy',        VERSION_FROM    => 'lib/Big/Dummy.pm',        INSTALLMAN3DIR  => 'none'    );    ok( !keys %{ $mm->{MAN3PODS} } );}{    my $mm = WriteMakefile(        NAME            => 'Big::Dummy',        VERSION_FROM    => 'lib/Big/Dummy.pm',        MAN3PODS        => {}    );    is_deeply( $mm->{MAN3PODS}, { } );}{    my $mm = WriteMakefile(        NAME            => 'Big::Dummy',        VERSION_FROM    => 'lib/Big/Dummy.pm',        MAN3PODS        => { "Foo.pm" => "Foo.1" }    );    is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } );}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?