3 # Wherein we ensure that postamble works ok.
11 use Test::More tests => 8;
12 use MakeMaker::Test::Utils;
13 use MakeMaker::Test::Setup::BFD;
14 use ExtUtils::MakeMaker;
17 use File::Temp qw[tempdir];
18 my $tmpdir = tempdir( DIR => 't', CLEANUP => 1 );
23 my $Makefile = makefile_name;
25 ok( setup_recurs(), 'setup' );
27 ok( chdir File::Spec->updir );
28 ok( teardown_recurs(), 'teardown' );
31 ok( chdir 'Big-Dummy', q{chdir'd to Big-Dummy} ) ||
32 diag("chdir failed: $!");
36 local $SIG{__WARN__} = sub {
37 if ( $Config{usecrosscompile} ) {
38 # libraries might not be present on the target system
39 # when cross-compiling
40 return if $_[0] =~ /\A\QWarning (mostly harmless): No library found for \E.+/
42 $warnings = join '', @_;
45 my $stdout = tie *STDOUT, 'TieOut' or die;
46 my $mm = WriteMakefile(
48 VERSION_FROM => 'lib/Big/Dummy.pm',
54 is( $warnings, '', 'postamble argument not warned about' );
58 my($self, %extra) = @_;
60 is_deeply( \%extra, { FOO => 1, BAR => 'fugawazads' },
61 'postamble args passed' );
64 # This makes sure the postamble gets written
70 ok( open(MAKEFILE, $Makefile) ) or diag "Can't open $Makefile: $!";
72 like( <MAKEFILE>, qr/^\# This makes sure the postamble gets written\n/m,
73 'postamble added to the Makefile' );