From: Jarkko Hietaniemi Date: Sun, 27 Jul 2003 18:37:45 +0000 (+0000) Subject: Missing MakeMaker test. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=84a725ce7fe8d91d8384edf0aeea552b4d19c40e;p=p5sagit%2Fp5-mst-13.2.git Missing MakeMaker test. p4raw-id: //depot/perl@20237 --- diff --git a/MANIFEST b/MANIFEST index 15e1c72..21879ac 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1141,10 +1141,11 @@ lib/ExtUtils/t/MM_VMS.t See if ExtUtils::MM_VMS works lib/ExtUtils/t/MM_Win32.t See if ExtUtils::MM_Win32 works lib/ExtUtils/t/oneliner.t See if MM can generate perl one-liners lib/ExtUtils/t/Packlist.t See if Packlist works +lib/ExtUtils/t/postamble.t See if postamble works lib/ExtUtils/t/prefixify.t See if MakeMaker can apply a PREFIX lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems lib/ExtUtils/t/prompt.t See if E::MM::prompt() works -lib/ExtUtils/t/recurs.t See if recursive builds work +lib/ExtUtils/t/recurs.t See if recursive builds work lib/ExtUtils/t/split_command.t See if MM's xargs-like function works lib/ExtUtils/t/testlib.t See if ExtUtils::testlib works lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works @@ -2556,7 +2557,7 @@ t/lib/h2ph.h Test header file for h2ph t/lib/h2ph.pht Generated output from h2ph.h by h2ph, for comparison t/lib/locale/latin1 Part of locale.t in Latin 1 t/lib/locale/utf8 Part of locale.t in UTF8 -t/lib/MakeMaker/Test/Setup/Recurs.pm MakeMaker test utilities +t/lib/MakeMaker/Test/Setup/Recurs.pm MakeMaker test utilities t/lib/MakeMaker/Test/Utils.pm MakeMaker test utilities t/lib/Math/BigFloat/Subclass.pm Empty subclass of BigFloat for test t/lib/Math/BigInt/BareCalc.pm Bigint's simulation of Calc diff --git a/lib/ExtUtils/t/postamble.t b/lib/ExtUtils/t/postamble.t new file mode 100644 index 0000000..b8c0492 --- /dev/null +++ b/lib/ExtUtils/t/postamble.t @@ -0,0 +1,65 @@ +#!/usr/bin/perl -w + +# Wherein we ensure that postamble works ok. + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Test::More tests => 5; +use MakeMaker::Test::Utils; +use ExtUtils::MakeMaker; +use TieOut; + +chdir 't'; +perl_lib; +$| = 1; + +my $Makefile = makefile_name; + +ok( chdir 'Big-Dummy', q{chdir'd to Big-Dummy} ) || + diag("chdir failed: $!"); + +{ + my $warnings = ''; + local $SIG{__WARN__} = sub { + $warnings = join '', @_; + }; + + my $stdout = tie *STDOUT, 'TieOut' or die; + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + postamble => { + FOO => 1, + BAR => "fugawazads" + } + ); + is( $warnings, '', 'postamble argument not warned about' ); +} + +sub MY::postamble { + my($self, %extra) = @_; + + is_deeply( \%extra, { FOO => 1, BAR => 'fugawazads' }, + 'postamble args passed' ); + + return <, qr/^\# This makes sure the postamble gets written\n/m, + 'postamble added to the Makefile' ); +}