diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-05-21 09:18:07 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-05-21 09:18:07 +0000 |
commit | 4325052d2625a06294068527f0d65e6f637a59ee (patch) | |
tree | dfb12d4ad8e6c5d1e259dd8f6df46f6fa7391308 /t | |
parent | b15aece354b2aec9d338e59acb2abc2deeebc3c0 (diff) | |
download | perl-4325052d2625a06294068527f0d65e6f637a59ee.tar.gz |
Update to MakeMaker 6.30
p4raw-id: //depot/perl@24524
Diffstat (limited to 't')
-rw-r--r-- | t/lib/MakeMaker/Test/Setup/PL_FILES.pm | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/t/lib/MakeMaker/Test/Setup/PL_FILES.pm b/t/lib/MakeMaker/Test/Setup/PL_FILES.pm index 73b77e3a7f..98cbebdf64 100644 --- a/t/lib/MakeMaker/Test/Setup/PL_FILES.pm +++ b/t/lib/MakeMaker/Test/Setup/PL_FILES.pm @@ -18,13 +18,22 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'PL_FILES::Module', PL_FILES => { 'single.PL' => 'single.out', - 'multi.PL' => [qw(1.out 2.out)] + 'multi.PL' => [qw(1.out 2.out)], + 'Bar_pm.PL' => '$(INST_LIB)/PL/Bar.pm', } ); END - 'PL_FILES-Module/single.PL' => _gen_pl_files(), - 'PL_FILES-Module/multi.PL' => _gen_pl_files(), + 'PL_FILES-Module/single.PL' => _gen_pl_files(), + 'PL_FILES-Module/multi.PL' => _gen_pl_files(), + 'PL_FILES-Module/Bar_pm.PL' => _gen_pm_files(), + 'PL_FILES-Module/lib/PL/Foo.pm' => <<'END', +# Module to load to ensure PL_FILES have blib in @INC. +package PL::Foo; +sub bar { 42 } +1; +END + ); @@ -32,6 +41,35 @@ sub _gen_pl_files { my $test = <<'END'; #!/usr/bin/perl -w +# Ensure we have blib in @INC +use PL::Foo; +die unless PL::Foo::bar() == 42; + +# Had a bug where PL_FILES weren't sent the file to generate +die "argv empty\n" unless @ARGV; +die "too many in argv: @ARGV\n" unless @ARGV == 1; + +my $file = $ARGV[0]; +open OUT, ">$file" or die $!; + +print OUT "Testing\n"; +close OUT +END + + $test =~ s/^\n//; + + return $test; +} + + +sub _gen_pm_files { + my $test = <<'END'; +#!/usr/bin/perl -w + +# Ensure we do NOT have blib in @INC when building a module +eval { require PL::Foo; }; +#die $@ unless $@ =~ m{^Can't locate PL/Foo.pm in \@INC }; + # Had a bug where PL_FILES weren't sent the file to generate die "argv empty\n" unless @ARGV; die "too many in argv: @ARGV\n" unless @ARGV == 1; |