diff options
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Module-Build/t/lib')
4 files changed, 64 insertions, 11 deletions
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm index 9fbd6d0c8ca..ae8ed343907 100644 --- a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm +++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm @@ -84,6 +84,8 @@ sub reset { my %options = @_; $options{name} ||= 'Simple'; + $options{version} ||= q{'0.01'}; + $options{license} ||= 'perl'; $options{dir} = File::Spec->rel2abs( defined $options{dir} ? $options{dir} : MBTest->tmpdir ); @@ -151,7 +153,7 @@ sub _gen_default_filedata { my \$builder = Module::Build->new( module_name => '$self->{name}', - license => 'perl', + license => '$self->{license}', ); \$builder->create_build_script(); @@ -164,7 +166,7 @@ sub _gen_default_filedata { my \$builder = Module::Build->new( module_name => '$self->{name}', - license => 'perl', + license => '$self->{license}', ); \$builder->create_build_script(); @@ -179,7 +181,7 @@ sub _gen_default_filedata { package $self->{name}; use vars qw( \$VERSION ); - \$VERSION = '0.01'; + \$VERSION = $self->{version}; use strict; @@ -214,7 +216,7 @@ sub _gen_default_filedata { $self->$add_unless($module_filename, undent(<<" ---")); package $self->{name}; - \$VERSION = '0.01'; + \$VERSION = $self->{version}; require Exporter; require DynaLoader; @@ -627,6 +629,8 @@ The C<new> method does not write any files -- see L</regen()> below. my $dist = DistGen->new( name => 'Foo::Bar', + version => '0.01', + license => 'perl', dir => MBTest->tmpdir, xs => 1, no_manifest => 0, @@ -642,6 +646,17 @@ The name of the module this distribution represents. The default is 'Simple'. This should be a "Foo::Bar" (module) name, not a "Foo-Bar" dist name. +=item version + +The version string that will be set. (E.g. C<our $VERSION = 0.01>) +Note -- to put this value in quotes, add those to the string. + + version => q{'0.01_01'} + +=item license + +The license string that will be set in Build.PL. Defaults to 'perl'. + =item dir The (parent) directory in which to create the distribution directory. The diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm index 6dc4c8627a4..0df382fc6aa 100644 --- a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm +++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm @@ -12,6 +12,7 @@ use File::Path (); BEGIN { # Environment variables which might effect our testing my @delete_env_keys = qw( + HOME DEVEL_COVER_OPTIONS MODULEBUILDRC PERL_MB_OPT @@ -54,12 +55,10 @@ BEGIN { my $t_lib = File::Spec->catdir('t', 'bundled'); push @INC, $t_lib; # Let user's installed version override - if ($ENV{PERL_CORE}) { - # We change directories, so expand @INC and $^X to absolute paths - # Also add . - @INC = (map(File::Spec->rel2abs($_), @INC), "."); - $^X = File::Spec->rel2abs($^X); - } + # We change directories, so expand @INC and $^X to absolute paths + # Also add . + @INC = (map(File::Spec->rel2abs($_), @INC), "."); + $^X = File::Spec->rel2abs($^X); } use Exporter; @@ -96,7 +95,11 @@ __PACKAGE__->export(scalar caller, @extra_exports); # always return to the current directory { - my $cwd = File::Spec->rel2abs(Cwd::cwd); + my $cwd; + # must be done in BEGIN because tmpdir uses it in BEGIN for $ENV{HOME} + BEGIN { + $cwd = File::Spec->rel2abs(Cwd::cwd); + } sub original_cwd { return $cwd } @@ -123,6 +126,10 @@ sub tmpdir { return File::Temp::tempdir('MB-XXXXXXXX', CLEANUP => 1, DIR => $dir, @args); } +BEGIN { + $ENV{HOME} = tmpdir; # don't want .modulebuildrc or other things interfering +} + sub save_handle { my ($handle, $subr) = @_; my $outfile = File::Spec->catfile(File::Spec->tmpdir, temp_file_name()); @@ -201,6 +208,9 @@ sub check_compiler { my $have_c_compiler; stderr_of( sub {$have_c_compiler = $mb->have_c_compiler} ); + # XXX link_executable() is not yet implemented for Windows + # and noexec tmpdir is irrelevant on Windows + return ($have_c_compiler, 1) if $^O eq "MSWin32"; # check noexec tmpdir my $tmp_exec; diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Module/Signature.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Module/Signature.pm new file mode 100644 index 00000000000..2d58f7d6dd0 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Module/Signature.pm @@ -0,0 +1,11 @@ +package Module::Signature; # mocked +use strict; +use warnings; +our $VERSION = 999; + +sub sign { + open my $fh, ">", "SIGNATURE"; + print {$fh} "SIGNATURE"; +} + +1; diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Software/License/VaporWare.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Software/License/VaporWare.pm new file mode 100644 index 00000000000..80d9fa5e784 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Software/License/VaporWare.pm @@ -0,0 +1,17 @@ +use strict; +use warnings; + +package Software::License::VaporWare; +our $VERSION = '0.001'; + +use Software::License; +our @ISA = qw/Software::License/; + +sub name { 'VaporWare License' } +sub url { 'http://example.com/vaporware/' } +sub meta_name { 'unrestricted' } +sub meta2_name { 'unrestricted' } + +1; + + |