diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-18 08:34:00 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-18 08:34:00 +0000 |
commit | 2c91f887f15419ab4d5271c3d098f5e3c98ff314 (patch) | |
tree | 7bd1eca85e04951c7dabcce628846ec924445b98 /lib/ExtUtils/t | |
parent | 33869856bc668ad896e517e1aa0c9d977d5b2676 (diff) | |
download | perl-2c91f887f15419ab4d5271c3d098f5e3c98ff314.tar.gz |
Upgrade to ExtUtils::MakeMaker 6.16.
p4raw-id: //depot/perl@20754
Diffstat (limited to 'lib/ExtUtils/t')
-rw-r--r-- | lib/ExtUtils/t/00setup_dummy.t | 3 | ||||
-rw-r--r-- | lib/ExtUtils/t/Manifest.t | 21 | ||||
-rw-r--r-- | lib/ExtUtils/t/prereq_print.t | 66 |
3 files changed, 87 insertions, 3 deletions
diff --git a/lib/ExtUtils/t/00setup_dummy.t b/lib/ExtUtils/t/00setup_dummy.t index 2e6ea262cc..0b9e58d056 100644 --- a/lib/ExtUtils/t/00setup_dummy.t +++ b/lib/ExtUtils/t/00setup_dummy.t @@ -51,7 +51,8 @@ END 'Big-Dummy/Makefile.PL' => <<'END', use ExtUtils::MakeMaker; -printf "Current package is: %s\n", __PACKAGE__; +# This will interfere with the PREREQ_PRINT tests. +printf "Current package is: %s\n", __PACKAGE__ unless "@ARGV" =~ /PREREQ/; WriteMakefile( NAME => 'Big::Dummy', diff --git a/lib/ExtUtils/t/Manifest.t b/lib/ExtUtils/t/Manifest.t index 0bea89ba06..50cf8697c7 100644 --- a/lib/ExtUtils/t/Manifest.t +++ b/lib/ExtUtils/t/Manifest.t @@ -14,7 +14,7 @@ chdir 't'; use strict; # these files help the test run -use Test::More tests => 39; +use Test::More tests => 41; use Cwd; # these files are needed for the module itself @@ -200,8 +200,25 @@ my %expect = ( 'makefile.pl' => '', ); is_deeply( $files, \%expect, 'maniadd() vs MANIFEST without trailing newline'); +SKIP: { + chmod( 0400, 'MANIFEST' ); + skip "Can't make MANIFEST read-only", 2 if -w 'MANIFEST'; + + eval { + maniadd({ 'META.yml' => 'hock' }); + }; + is( $@, '', "maniadd() won't open MANIFEST if it doesn't need to" ); + + eval { + maniadd({ 'grrrwoof' => 'yippie' }); + }; + like( $@, qr/^Could not open MANIFEST/, + "maniadd() dies if it can't open the MANIFEST" ); + +} + + END { - # the args are evaluated in scalar context is( unlink( keys %Files ), keys %Files, 'remove all added files' ); remove_dir( 'moretest', 'copy' ); diff --git a/lib/ExtUtils/t/prereq_print.t b/lib/ExtUtils/t/prereq_print.t new file mode 100644 index 0000000000..78dc6e8e1f --- /dev/null +++ b/lib/ExtUtils/t/prereq_print.t @@ -0,0 +1,66 @@ +#!/usr/bin/perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Config; + +use Test::More tests => 8; +use MakeMaker::Test::Utils; + +# 'make disttest' sets a bunch of environment variables which interfere +# with our testing. +delete @ENV{qw(PREFIX LIB MAKEFLAGS)}; + +my $Perl = which_perl(); +my $Makefile = makefile_name(); +my $Is_VMS = $^O eq 'VMS'; + +chdir($Is_VMS ? 'BFD_TEST_ROOT:[t]' : 't'); +perl_lib; + +$| = 1; + +ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) || + diag("chdir failed: $!"); + +unlink $Makefile; +my $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=1"}); +ok( !-r $Makefile, "PREREQ_PRINT produces no $Makefile" ); +is( $?, 0, ' exited normally' ); +{ + package _Prereq::Print; + no strict; + $PREREQ_PM = undef; # shut up "used only once" warning. + eval $prereq_out; + ::is_deeply( $PREREQ_PM, { strict => 0 }, 'prereqs dumped' ); + ::is( $@, '', ' without error' ); +} + + +$prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"}); +ok( !-r $Makefile, "PRINT_PREREQ produces no $Makefile" ); +is( $?, 0, ' exited normally' ); +::like( $prereq_out, qr/^perl\(strict\) \s* >= \s* 0 \s*$/x, + 'prereqs dumped' ); + + +# Currently a bug. +#my $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=0"}); +#ok( -r $Makefile, "PREREQ_PRINT=0 produces a $Makefile" ); +#is( $?, 0, ' exited normally' ); +#unlink $Makefile; + +# Currently a bug. +#my $prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"}); +#ok( -r $Makefile, "PRINT_PREREQ=0 produces a $Makefile" ); +#is( $?, 0, ' exited normally' ); +#unlink $Makefile; |