module-build-checkins Mailing List for Module::Build (Page 22)
Status: Beta
Brought to you by:
kwilliams
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(82) |
Dec
(58) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(49) |
Feb
(57) |
Mar
(49) |
Apr
(49) |
May
(2) |
Jun
(147) |
Jul
(60) |
Aug
(55) |
Sep
(51) |
Oct
(68) |
Nov
(61) |
Dec
(44) |
| 2006 |
Jan
(27) |
Feb
(38) |
Mar
(89) |
Apr
(31) |
May
(17) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Randy W. S. <si...@us...> - 2005-07-09 12:20:17
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14252/t/lib Modified Files: DistGen.pm Log Message: Don't 'use warnings'. Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- DistGen.pm 1 Jul 2005 11:14:53 -0000 1.10 +++ DistGen.pm 9 Jul 2005 12:20:06 -0000 1.11 @@ -45,8 +45,6 @@ $self->add_file( 'Build.PL', <<"---" ) unless $self->{filedata}{'Build.PL'}; use strict; -use warnings; - use Module::Build; my \$builder = Module::Build->new( @@ -68,7 +66,6 @@ \$VERSION = '0.01'; use strict; -use warnings; 1; |
|
From: Randy W. S. <si...@us...> - 2005-07-09 12:18:20
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12735/lib/Module/Build Modified Files: Base.pm Log Message: Don't allow undefined distribution version. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.457 retrieving revision 1.458 diff -u -d -r1.457 -r1.458 --- Base.pm 8 Jul 2005 01:39:46 -0000 1.457 +++ Base.pm 9 Jul 2005 12:18:08 -0000 1.458 @@ -680,21 +680,24 @@ sub dist_version { my ($self) = @_; my $p = $self->{properties}; - + return $p->{dist_version} if defined $p->{dist_version}; - + if ($self->module_name) { $p->{dist_version_from} ||= join( '/', 'lib', split '::', $self->module_name ) . '.pm'; } - + + if ( $p->{dist_version_from} ) { + my $version_from = File::Spec->catfile( split( qr{/}, $p->{dist_version_from} ) ); + my $pm_info = Module::Build::ModuleInfo->new_from_file( $version_from ); + $p->{dist_version} = $pm_info->version(); + } + die ("Can't determine distribution version, must supply either 'dist_version',\n". "'dist_version_from', or 'module_name' parameter") - unless $p->{dist_version_from}; - - my $version_from = File::Spec->catfile( split '/', $p->{dist_version_from} ); - - my $pm_info = Module::Build::ModuleInfo->new_from_file( $version_from ); - return $p->{dist_version} = $pm_info->version(); + unless $p->{dist_version}; + + return $p->{dist_version}; } sub dist_author { shift->_pod_parse('author') } |
|
From: Ken W. <kwi...@us...> - 2005-07-08 01:43:41
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17475/lib/Module/Build Modified Files: Authoring.pod Log Message: Update the info about generated README files Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Authoring.pod 5 May 2005 17:20:39 -0000 1.9 +++ Authoring.pod 8 Jul 2005 01:43:32 -0000 1.10 @@ -200,11 +200,16 @@ This parameter tells Module::Build to automatically create a F<README> file at the top level of your distribution. Currently it will simply -use C<Pod::Text> on the file indicated by C<dist_version_from> and put +use C<Pod::Text> (or C<Pod::Readme> if it's installed) on the file +indicated by C<dist_version_from> and put the result in the F<README> file. This is by no means the only recommended style for writing a README, but it seems to be one common one used on the CPAN. +If you generate a F<README> in this way, it's probably a good idea to +create a separate F<INSTALL> file if that information isn't in the +generated F<README>. + =item dist_abstract This should be a short description of the distribution. This is used |
|
From: Ken W. <kwi...@us...> - 2005-07-08 01:39:57
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14881 Modified Files: Changes Log Message: Fall back to Pod::Text if Pod::Readme is not installed Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.357 retrieving revision 1.358 diff -u -d -r1.357 -r1.358 --- Changes 8 Jul 2005 01:29:22 -0000 1.357 +++ Changes 8 Jul 2005 01:39:46 -0000 1.358 @@ -26,10 +26,10 @@ places, and help people not to panic when they look at it. [Spotted by Yves] - - We now use Pod::Readme instead of Pod::Text to generate the README - file when the 'create_readme' option is used. The disadvantage is - that it's not a core module, but the advantages are pretty nice. - [Robert Rothenberg] + - We now use Pod::Readme by default (instead of Pod::Text) to + generate the README file when the 'create_readme' option is used. + If Pod::Readme is not installed, we will still fall back to using + Pod::Text. [Robert Rothenberg] - The values of the "prefix", "install_base", "install_path", and "install_dest" parameters can now begin with "~" or "~user", and |
|
From: Ken W. <kwi...@us...> - 2005-07-08 01:39:57
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14881/lib/Module/Build Modified Files: Base.pm Log Message: Fall back to Pod::Text if Pod::Readme is not installed Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.456 retrieving revision 1.457 diff -u -d -r1.456 -r1.457 --- Base.pm 5 Jul 2005 17:59:12 -0000 1.456 +++ Base.pm 8 Jul 2005 01:39:46 -0000 1.457 @@ -2283,10 +2283,11 @@ sub do_create_readme { my $self = shift; - require Pod::Readme; $self->delete_filetree('README'); - $self->log_info("Creating README\n"); - my $parser = Pod::Readme->new; + my $parser = eval {require Pod::Readme; 1} ? Pod::Readme->new : + eval {require Pod::Text; 1} ? Pod::Text->new : + die "Can't load Pod::Readme or Pod::Text to create README"; + $self->log_info("Creating README using " . ref($parser) . "\n"); $parser->parse_from_file($self->dist_version_from, 'README', @_); $self->_add_to_manifest('MANIFEST', 'README'); } |
|
From: Ken W. <kwi...@us...> - 2005-07-08 01:30:03
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9199 Modified Files: Changes Log Message: Don't die when an author can't be determined Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.356 retrieving revision 1.357 diff -u -d -r1.356 -r1.357 --- Changes 5 Jul 2005 17:57:00 -0000 1.356 +++ Changes 8 Jul 2005 01:29:22 -0000 1.357 @@ -63,6 +63,11 @@ some issues with this solution, however. See ticket #13169 in rt.cpan.org. [Reported by Jos Boumans] + - Fixed a fatal error that occurred when a distribution's author + could not be determined from its POD nor from the call to + Module::Build->new() in its Build.PL. See ticket #12318 in + rt.cpan.org. [Reported by Jos Boumans] + 0.27_01 (Beta for 0.28) Fri Apr 15 21:12:57 CDT 2005 Backward-incompatible (but better) changes: |
|
From: Ken W. <kwi...@us...> - 2005-07-08 01:29:46
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9199/t Modified Files: pod_parser.t Log Message: Don't die when an author can't be determined Index: pod_parser.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/pod_parser.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pod_parser.t 28 Jun 2005 03:55:19 -0000 1.3 +++ pod_parser.t 8 Jul 2005 01:29:38 -0000 1.4 @@ -3,7 +3,7 @@ use lib 't/lib'; use strict; -use Test::More tests => 4; +use Test::More tests => 7; use File::Spec (); @@ -54,3 +54,24 @@ is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh...@ex...<gt>> in 2004.', 'author'; is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract'; + + +{ + # Try again without a valid author spec + untie *FH; + tie *FH, 'IO::StringBased', <<'EOF'; +=head1 NAME + +Foo::Bar - Perl extension for blah blah blah + +=cut +EOF + + my $pp = Module::Build::PodParser->new(fh => \*FH); + ok $pp, 'object created'; + + is_deeply $pp->get_author, [], 'author'; + is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract'; +} + + |
|
From: Ken W. <kwi...@us...> - 2005-07-08 01:29:46
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9199/lib/Module/Build Modified Files: PodParser.pm Log Message: Don't die when an author can't be determined Index: PodParser.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/PodParser.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- PodParser.pm 13 May 2004 04:48:56 -0000 1.5 +++ PodParser.pm 8 Jul 2005 01:29:22 -0000 1.6 @@ -66,7 +66,7 @@ $self->parse_from_filehandle($self->{fh}); - return $self->{author}; + return $self->{author} || []; } ################## Pod::Parser overrides ########### |
|
From: Ken W. <kwi...@us...> - 2005-07-05 17:59:21
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24962/lib/Module/Build Modified Files: Base.pm Log Message: Create a localize_dir_path() method Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.455 retrieving revision 1.456 diff -u -d -r1.455 -r1.456 --- Base.pm 5 Jul 2005 17:58:08 -0000 1.455 +++ Base.pm 5 Jul 2005 17:59:12 -0000 1.456 @@ -1794,10 +1794,14 @@ sub localize_file_path { my ($self, $path) = @_; - return $path unless $path =~ m{/}; return File::Spec->catfile( split m{/}, $path ); } +sub localize_dir_path { + my ($self, $path) = @_; + return File::Spec->catdir( split m{/}, $path ); +} + sub fix_shebang_line { # Adapted from fixin() in ExtUtils::MM_Unix 1.35 my ($self, @files) = @_; my $c = $self->{config}; @@ -1929,7 +1933,7 @@ my ($self, $dirs, %args) = @_; my %files; foreach my $spec (@$dirs) { - my $dir = $self->localize_file_path($spec); + my $dir = $self->localize_dir_path($spec); next unless -e $dir; FILE: foreach my $file ( @{ $self->rscan_dir( $dir ) } ) { foreach my $regexp ( @{ $args{exclude} } ) { |
|
From: Ken W. <kwi...@us...> - 2005-07-05 17:58:17
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24350/lib/Module/Build Modified Files: Base.pm Log Message: Fix a hardcoded slash problem in filenames Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.454 retrieving revision 1.455 diff -u -d -r1.454 -r1.455 --- Base.pm 5 Jul 2005 17:54:35 -0000 1.454 +++ Base.pm 5 Jul 2005 17:58:08 -0000 1.455 @@ -139,8 +139,9 @@ $p->{perl} = $self->find_perl_interpreter or $self->log_warn("Warning: Can't locate your perl binary"); - $p->{bindoc_dirs} ||= [ "$p->{blib}/script" ]; - $p->{libdoc_dirs} ||= [ "$p->{blib}/lib", "$p->{blib}/arch" ]; + my $blibdir = sub { File::Spec->catdir($p->{blib}, @_) }; + $p->{bindoc_dirs} ||= [ $blibdir->("script") ]; + $p->{libdoc_dirs} ||= [ $blibdir->("lib"), $blibdir->("arch") ]; $p->{dist_author} = [ $p->{dist_author} ] if defined $p->{dist_author} and not ref $p->{dist_author}; |
|
From: Ken W. <kwi...@us...> - 2005-07-05 17:57:10
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23959 Modified Files: Changes Log Message: Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.355 retrieving revision 1.356 diff -u -d -r1.355 -r1.356 --- Changes 27 Jun 2005 18:54:25 -0000 1.355 +++ Changes 5 Jul 2005 17:57:00 -0000 1.356 @@ -58,6 +58,11 @@ which threw off one of our tests. We now allow for this different format. [Reported by Scott Godin] + - Fixed an issue that prevented Module::Build from upgrading itself + using its own API (which is how CPANPLUS uses it). There are still + some issues with this solution, however. See ticket #13169 in + rt.cpan.org. [Reported by Jos Boumans] + 0.27_01 (Beta for 0.28) Fri Apr 15 21:12:57 CDT 2005 Backward-incompatible (but better) changes: |
|
From: Ken W. <kwi...@us...> - 2005-07-05 17:54:44
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22610/lib/Module/Build Modified Files: Base.pm Log Message: Run Build.PL in the current process for new_from_context() Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.453 retrieving revision 1.454 diff -u -d -r1.453 -r1.454 --- Base.pm 1 Jul 2005 11:33:35 -0000 1.453 +++ Base.pm 5 Jul 2005 17:54:35 -0000 1.454 @@ -81,8 +81,15 @@ # XXX Read the META.yml and see whether we need to run the Build.PL? - # Run the Build.PL - $package->run_perl_script('Build.PL', [], [$package->unparse_args(\%args)]); + # Run the Build.PL. We use do() rather than run_perl_script() so + # that it runs in this process rather than a subprocess, because we + # need to make sure that the environment is the same during Build.PL + # as it is during resume() (and thereafter). + { + local @ARGV = $package->unparse_args(\%args); + do 'Build.PL'; + die $@ if $@; + } return $package->resume; } |
|
From: Randy W. S. <si...@us...> - 2005-07-01 11:33:44
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7830/lib/Module/Build Modified Files: Base.pm Log Message: Correct the sense of version comparison. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.452 retrieving revision 1.453 diff -u -d -r1.452 -r1.453 --- Base.pm 1 Jul 2005 11:19:47 -0000 1.452 +++ Base.pm 1 Jul 2005 11:33:35 -0000 1.453 @@ -2610,11 +2610,11 @@ $prime{$package}{file} = $dist_files{$file}; $prime{$package}{version} = $version if defined( $version ); } else { - if ( exists( $alt{$package} ) && - exists( $alt{$package}{version} ) && - defined( $alt{$package}{version} ) ) { + if ( exists( $alt{$package} ) && + exists( $alt{$package}{version} ) && + defined( $alt{$package}{version} ) ) { # This should never happen because M::B::ModuleInfo catches it first - if ( $self->compare_versions( $version, '==', + if ( $self->compare_versions( $version, '!=', $alt{$package}{version} ) ) { $self->log_warn( "$package ($alt{$package}{version}) conflicts " . "with $package ($version)\n" ); |
|
From: Randy W. S. <si...@us...> - 2005-07-01 11:20:11
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1071/lib/Module/Build Modified Files: Base.pm ModuleInfo.pm Log Message: Provide more intelligent cataloging of provided packages. [cpan #13464] Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.451 retrieving revision 1.452 diff -u -d -r1.451 -r1.452 --- Base.pm 29 Jun 2005 06:38:59 -0000 1.451 +++ Base.pm 1 Jul 2005 11:19:47 -0000 1.452 @@ -2576,7 +2576,7 @@ sub find_dist_packages { my $self = shift; - + # Only packages in .pm files are candidates for inclusion here. # Only include things in the MANIFEST, not things in developer's # private stock. @@ -2589,22 +2589,60 @@ keys %$manifest; my @pm_files = grep {exists $dist_files{$_}} keys %{ $self->find_pm_files }; - - my %out; + + my( %prime, %alt ); foreach my $file (@pm_files) { next if $file =~ m{^t/}; # Skip things in t/ - - my $localfile = File::Spec->catfile( split m{/}, $file ); + + my @path = split( /\//, $file ); + (my $prime_package = join( '::', @path[1..$#path])) =~ s/\.pm$//; + + my $localfile = File::Spec->catfile( @path ); my $pm_info = Module::Build::ModuleInfo->new_from_file( $localfile ); - + foreach my $package ($pm_info->packages_inside($localfile)) { - $out{$package}{file} = $dist_files{$file}; - $out{$package}{version} = $pm_info->version( $package ) - if defined( $pm_info->version( $package ) ); + next if $package eq 'main'; # main can appear numerous times, ignore + next if (split( /::/, $package ))[-1] =~ /^_/; # private pkg, ignore + + my $version = $pm_info->version( $package ); + if ( $package eq $prime_package ) { + $prime{$package}{file} = $dist_files{$file}; + $prime{$package}{version} = $version if defined( $version ); + } else { + if ( exists( $alt{$package} ) && + exists( $alt{$package}{version} ) && + defined( $alt{$package}{version} ) ) { + # This should never happen because M::B::ModuleInfo catches it first + if ( $self->compare_versions( $version, '==', + $alt{$package}{version} ) ) { + $self->log_warn( "$package ($alt{$package}{version}) conflicts " . + "with $package ($version)\n" ); + } + } else { + $alt{$package}{file} = $dist_files{$file}; + $alt{$package}{version} = $version if defined( $version ); + } + } } } - return \%out; + + foreach my $package ( keys( %alt ) ) { + if ( exists( $prime{$package} ) ) { + my $p_vers = exists( $prime{$package}{version} ) ? + $prime{$package}{version} : '<undef>'; + if ( exists( $alt{$package}{version} ) && + $alt{$package}{version} ne $p_vers ) { + $self->log_warn( "Version declaration for package '$package' in " . + "'$prime{$package}{file}' ($p_vers) conflicts with " . + "'$alt{$package}{file}' ($alt{$package}{version})\n" ); + + } + } else { + $prime{$package} = $alt{$package}; + } + } + return \%prime; } sub make_tarball { Index: ModuleInfo.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/ModuleInfo.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ModuleInfo.pm 23 Apr 2005 12:00:14 -0000 1.4 +++ ModuleInfo.pm 1 Jul 2005 11:20:01 -0000 1.5 @@ -105,7 +105,7 @@ my $fh = IO::File->new( $filename ) or die( "Can't open '$filename': $!" ); - my( $in_pod, $seen_end ) = ( 0, 0 ); + my( $in_pod, $seen_end, $need_vers ) = ( 0, 0,0 ); my( @pkgs, %vers, %pod, @pod ); my $pkg = 'main'; my $pod_sect = ''; @@ -143,10 +143,12 @@ $pkg = $1; push( @pkgs, $pkg ) unless grep( $pkg eq $_, @pkgs ); $vers{$pkg} = undef unless exists( $vers{$pkg} ); + $need_vers = 1; # first non-comment line in undeclared package main is VERSION } elsif ( !exists($vers{main}) && $pkg eq 'main' && - $line =~ $VERS_REGEXP ) { + $line =~ $VERS_REGEXP ) { + $need_vers = 0; my $v = $self->_evaluate_version_line( $line ); $vers{$pkg} = $v; push( @pkgs, 'main' ); @@ -154,15 +156,20 @@ # first non-comement line in undeclared packge defines package main } elsif ( !exists($vers{main}) && $pkg eq 'main' && $line =~ /\w+/ ) { + $need_vers = 1; $vers{main} = ''; push( @pkgs, 'main' ); - } elsif ( $line =~ $VERS_REGEXP ) { + } elsif ( $line =~ $VERS_REGEXP && $need_vers ) { # only first keep if this is the first $VERSION seen - unless ( defined $vers{$pkg} && length $vers{$pkg} ) { - my $v = $self->_evaluate_version_line( $line ); + $need_vers = 0; + my $v = $self->_evaluate_version_line( $line ); + unless ( defined $vers{$pkg} && length $vers{$pkg} ) { $vers{$pkg} = $v; - } + } else { + warn "Package '$pkg' already declared with version '$vers{$pkg}'\n" . + " ignoring new version '$v'.\n"; + } } |
|
From: Randy W. S. <si...@us...> - 2005-07-01 11:20:10
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1071/t Added Files: metadata.t Log Message: Provide more intelligent cataloging of provided packages. [cpan #13464] --- NEW FILE: metadata.t --- #!/usr/bin/perl -w use lib 't/lib'; use strict; use Test::More tests => 50; use File::Spec (); my $common_pl = File::Spec->catfile( 't', 'common.pl' ); require $common_pl; use Cwd (); my $cwd = Cwd::cwd; my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; use Module::Build; my $mb = Module::Build->new_from_context; ############################################################ # File with corresponding package (w/ or w/o version) # Module/Foo.pm => Module::Foo v1.23 my $provides = $mb->find_dist_packages; is( $provides->{Simple}{version}, '0.01' ); # File with no corresponding package (w/ or w/o version) # Module/Foo.pm => Module::Baz v1.23 (No Module::Foo) $dist->change_file( 'lib/Simple.pm', <<'---' ); package Foo::Bar; $VERSION = '1.23'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( ! exists( $provides->{Simple} ) ); is( $provides->{'Foo::Bar'}{version}, '1.23' ); is( keys( %$provides ), 1 ); # Single file with multiple differing packages (w/ or w/o version) # Module/Foo.pm => Module::Foo # Module/Foo.pm => Module::Bar $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; package Foo::Bar; $VERSION = '1.23'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; is( $provides->{Simple}{version}, '1.23' ); is( $provides->{'Foo::Bar'}{version}, '1.23' ); is( keys( %$provides ), 2 ); # Single file with multiple differing packages, no corresponding package # Module/Foo.pm => Module::Baz # Module/Foo.pm => Module::Bar $dist->change_file( 'lib/Simple.pm', <<'---' ); package Foo; $VERSION = '1.23'; 1; package Foo::Bar; $VERSION = '1.23'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( ! exists( $provides->{Simple} ) ); is( $provides->{'Foo'}{version}, '1.23' ); is( $provides->{'Foo::Bar'}{version}, '1.23' ); is( keys( %$provides ), 2 ); # Single file with same package appearing multiple times, no version # Module/Foo.pm => Module::Foo # Module/Foo.pm => Module::Foo $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; 1; package Simple; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( exists( $provides->{'Simple'} ) ); ok( ! exists( $provides->{'Simple'}{version} ) ); is( keys( %$provides ), 1 ); # Single file with same package appearing multiple times, single version # Module/Foo.pm => Module::Foo v1.23 # Module/Foo.pm => Module::Foo $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; package Simple; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( exists( $provides->{'Simple'}{version} ) ); is( $provides->{'Simple'}{version}, '1.23' ); is( keys( %$provides ), 1 ); # Single file with same package appearing multiple times, single version # Module/Foo.pm => Module::Foo # Module/Foo.pm => Module::Foo v1.23 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; 1; package Simple; $VERSION = '1.23'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( exists( $provides->{'Simple'}{version} ) ); is( $provides->{'Simple'}{version}, '1.23' ); is( keys( %$provides ), 1 ); # Single file with same package appearing multiple times, conflicting versions # Module/Foo.pm => Module::Foo v1.23 # Module/Foo.pm => Module::Foo v2.34 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; package Simple; $VERSION = '2.34'; 1; --- $dist->regen( clean => 1 ); my $err = ''; $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( exists( $provides->{'Simple'}{version} ) ); is( $provides->{'Simple'}{version}, '1.23' ); like( $err, qr/already declared/ ); is( keys( %$provides ), 1 ); # (Same as above three cases except with no corresponding package) # Module/Foo.pm => Module::Baz # Module/Foo.pm => Module::Baz $dist->change_file( 'lib/Simple.pm', <<'---' ); package Foo; $VERSION = '1.23'; 1; package Foo; $VERSION = '2.34'; 1; --- $dist->regen( clean => 1 ); $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( exists( $provides->{'Foo'}{version} ) ); is( $provides->{'Foo'}{version}, '1.23' ); like( $err, qr/already declared/ ); is( keys( %$provides ), 1 ); # Multiple files with same package, no version # Module/Foo.pm => Module::Foo # Module/Bar.pm => Module::Foo $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; 1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( exists( $provides->{'Simple'} ) ); ok( ! exists( $provides->{'Simple'}{version} ) ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); # Multiple files with same package, single version in corresponding package # Module/Foo.pm => Module::Foo v1.23 # Module/Bar.pm => Module::Foo $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( exists( $provides->{'Simple'}{version} ) ); is( $provides->{'Simple'}{version}, '1.23' ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); # Multiple files with same package, # single version in non-corresponding package # Module/Foo.pm => Module::Foo # Module/Bar.pm => Module::Foo v1.23 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; 1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( ! exists( $provides->{'Simple'}{version} ) ); ok( ! defined( $provides->{'Simple'}{version} ) ); like( $err, qr/conflicts/ ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); # Multiple files with same package, conflicting versions # Module/Foo.pm => Module::Foo v1.23 # Module/Bar.pm => Module::Foo v2.34 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; $VERSION = '2.34'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( exists( $provides->{'Simple'}{version} ) ); is( $provides->{'Simple'}{version}, '1.23' ); like( $err, qr/conflicts/ ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); # Multiple files with same package, multiple agreeing versions # Module/Foo.pm => Module::Foo v1.23 # Module/Bar.pm => Module::Foo v1.23 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( exists( $provides->{'Simple'}{version} ) ); is( $provides->{'Simple'}{version}, '1.23' ); is( $err, '' ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); # (Same as above five cases except with non-corresponding package) # Module/Foo.pm => Module::Baz # Module/Bar.pm => Module::Baz # What about private packages? # Module/Foo.pm => Module::_Private $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; 1; package Simple::_private; $VERSION = '2.34'; 1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( exists( $provides->{Simple} ) ); is( $provides->{'Simple'}{version}, '1.23' ); ok( ! exists( $provides->{'Simple::_private'} ) ); is( keys( %$provides ), 1 ); # Files with no packages? # Module/Foo.pm => =pod..=cut (no package declaration) # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; use File::Path; rmtree( $tmp ); |
|
From: Randy W. S. <si...@us...> - 2005-07-01 11:15:07
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31041/t/lib Modified Files: DistGen.pm Log Message: Remove uses of 'our' in generated distributions. Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- DistGen.pm 29 Jun 2005 07:55:58 -0000 1.9 +++ DistGen.pm 1 Jul 2005 11:14:53 -0000 1.10 @@ -64,6 +64,7 @@ $self->add_file( $module_filename, <<"---" ) unless $self->{filedata}{$module_filename}; package $self->{name}; +use vars qw( \$VERSION ); \$VERSION = '0.01'; use strict; @@ -102,8 +103,9 @@ use base qw( Exporter DynaLoader ); -our \$VERSION = '0.01'; -our \@EXPORT_OK = qw( ok ); +use vars qw( \$VERSION \@EXPORT_OK ); +\$VERSION = '0.01'; +\@EXPORT_OK = qw( ok ); bootstrap $self->{name} \$VERSION; @@ -340,12 +342,13 @@ =head1 NAME -DistGen +DistGen - Creates simple distributions for testing. =head1 DESCRIPTION + =head1 API |
|
From: Randy W. S. <si...@us...> - 2005-06-29 08:27:20
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13337/t Modified Files: basic.t compat.t destinations.t extend.t files.t install.t manifypods.t notes.t runthrough.t signature.t xs.t Log Message: Use consistent variable names across all test modules. Index: files.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/files.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- files.t 29 Jun 2005 07:50:40 -0000 1.7 +++ files.t 29 Jun 2005 08:27:06 -0000 1.8 @@ -22,7 +22,7 @@ use Module::Build; -my $m = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context; my @files; { @@ -31,7 +31,7 @@ my @tmp; foreach (1..2) { my $tmp = File::Spec->catdir('t', "tmp$_"); - $m->add_to_cleanup($tmp); + $mb->add_to_cleanup($tmp); push @files, $tmp; unless (-d $tmp) { mkdir($tmp, 0777) or die "Can't create $tmp: $!"; @@ -49,7 +49,7 @@ ok -e $file; - my $file2 = $m->copy_if_modified(from => $file, to_dir => $tmp[2]); + my $file2 = $mb->copy_if_modified(from => $file, to_dir => $tmp[2]); ok $file2; ok -e $file2; } Index: signature.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/signature.t,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- signature.t 29 Jun 2005 07:50:41 -0000 1.11 +++ signature.t 29 Jun 2005 08:27:06 -0000 1.12 @@ -47,13 +47,13 @@ use Module::Build; -my $build = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context; { - eval {$build->dispatch('distdir')}; + eval {$mb->dispatch('distdir')}; ok ! $@; - chdir( $build->dist_dir ) or die "Can't chdir to '@{[$build->dist_dir]}': $!"; + chdir( $mb->dist_dir ) or die "Can't chdir to '@{[$mb->dist_dir]}': $!"; ok -e 'SIGNATURE'; # Make sure the signature actually verifies @@ -69,14 +69,14 @@ local $^W; # Skip 'redefined' warnings local *Module::Signature::sign = sub { push @run_order, 'sign' }; local *Module::Build::Base::ACTION_distmeta = sub { push @run_order, 'distmeta' }; - eval { $build->dispatch('distdir') }; + eval { $mb->dispatch('distdir') }; } ok ! $@; is $run_order[0], 'distmeta'; is $run_order[1], 'sign'; } -eval { $build->dispatch('realclean') }; +eval { $mb->dispatch('realclean') }; ok ! $@; Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- compat.t 29 Jun 2005 07:50:40 -0000 1.30 +++ compat.t 29 Jun 2005 08:27:06 -0000 1.31 @@ -53,27 +53,27 @@ ######################### -my $build = Module::Build->new_from_context; -ok $build; +my $mb = Module::Build->new_from_context; +ok $mb; foreach my $type (@makefile_types) { - Module::Build::Compat->create_makefile_pl($type, $build); - test_makefile_creation($build); + Module::Build::Compat->create_makefile_pl($type, $mb); + test_makefile_creation($mb); - ok $build->do_system(@make); + ok $mb->do_system(@make); # Can't let 'test' STDOUT go to our STDOUT, or it'll confuse Test::Harness. my $success; my $output = stdout_of( sub { - $success = $build->do_system(@make, 'test'); + $success = $mb->do_system(@make, 'test'); } ); ok $success; like uc $output, qr{DONE\.|SUCCESS}; - ok $build->do_system(@make, 'realclean'); + ok $mb->do_system(@make, 'realclean'); # Try again with some Makefile.PL arguments - test_makefile_creation($build, [], 'INSTALLDIRS=vendor', 1); + test_makefile_creation($mb, [], 'INSTALLDIRS=vendor', 1); 1 while unlink 'Makefile.PL'; ok ! -e 'Makefile.PL'; @@ -102,7 +102,7 @@ # Should fail with "can't find Foo/Builder.pm" my $warning = stderr_of (sub { - my $result = $build->run_perl_script('Makefile.PL'); + my $result = $mb->run_perl_script('Makefile.PL'); ok ! $result; }); like $warning, qr{Foo/Builder.pm}; @@ -113,24 +113,24 @@ foreach my $style ('passthrough', 'small') { Module::Build::Compat->create_makefile_pl($style, $bar_builder); ok -e 'Makefile.PL'; - ok $build->run_perl_script('Makefile.PL'); + ok $mb->run_perl_script('Makefile.PL'); } } { # Make sure various Makefile.PL arguments are supported - Module::Build::Compat->create_makefile_pl('passthrough', $build); + Module::Build::Compat->create_makefile_pl('passthrough', $mb); my $libdir = File::Spec->catdir( $cwd, 't', 'libdir' ); - my $result = $build->run_perl_script('Makefile.PL', [], - [ - 'SKIP_RCFILE=1', - "LIB=$libdir", - 'TEST_VERBOSE=1', - 'INSTALLDIRS=perl', - 'POLLUTE=1', - ] - ); + my $result = $mb->run_perl_script('Makefile.PL', [], + [ + 'SKIP_RCFILE=1', + "LIB=$libdir", + 'TEST_VERBOSE=1', + 'INSTALLDIRS=perl', + 'POLLUTE=1', + ] + ); ok $result; ok -e 'Build.PL'; @@ -148,16 +148,16 @@ like $output, qr/(?:# ok \d+\s+)+/, 'Should be verbose'; # Make sure various Makefile arguments are supported - $output = stdout_of( sub { $ran_ok = $build->do_system(@make, 'test', 'TEST_VERBOSE=0') } ); + $output = stdout_of( sub { $ran_ok = $mb->do_system(@make, 'test', 'TEST_VERBOSE=0') } ); ok $ran_ok; $output =~ s/^/# /gm; # Don't confuse our own test output like $output, qr/(?:# .+basic\.+ok\s+(?:[\d.]s\s*)?)+# All tests/, 'Should be non-verbose'; - $build->delete_filetree($libdir); + $mb->delete_filetree($libdir); ok ! -e $libdir, "Sample installation directory should be cleaned up"; - $build->do_system(@make, 'realclean'); + $mb->do_system(@make, 'realclean'); ok ! -e 'Makefile', "Makefile shouldn't exist"; 1 while unlink 'Makefile.PL'; @@ -169,14 +169,14 @@ # C<glob> on MSWin32 uses $ENV{HOME} if defined to do tilde-expansion local $ENV{HOME} = 'C:/' if $^O =~ /MSWin/ && !exists( $ENV{HOME} ); - Module::Build::Compat->create_makefile_pl('passthrough', $build); + Module::Build::Compat->create_makefile_pl('passthrough', $mb); - $build->run_perl_script('Makefile.PL', [], ['INSTALL_BASE=~/foo']); + $mb->run_perl_script('Makefile.PL', [], ['INSTALL_BASE=~/foo']); my $b2 = Module::Build->current; ok $b2->install_base; unlike $b2->install_base, qr/^~/, "Tildes should be expanded"; - $build->do_system(@make, 'realclean'); + $mb->do_system(@make, 'realclean'); 1 while unlink 'Makefile.PL'; } ######################################################### Index: install.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/install.t,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- install.t 29 Jun 2005 07:50:40 -0000 1.21 +++ install.t 29 Jun 2005 08:27:06 -0000 1.22 @@ -44,18 +44,18 @@ --- $dist->regen; -my $build = Module::Build->new_from_context; -ok $build; +my $mb = Module::Build->new_from_context; +ok $mb; my $destdir = File::Spec->catdir($cwd, 't', 'install_test'); -$build->add_to_cleanup($destdir); +$mb->add_to_cleanup($destdir); { - eval {$build->dispatch('install', destdir => $destdir)}; + eval {$mb->dispatch('install', destdir => $destdir)}; ok ! $@; - my $libdir = strip_volume( $build->install_destination('lib') ); + my $libdir = strip_volume( $mb->install_destination('lib') ); my $install_to = File::Spec->catfile($destdir, $libdir, $dist->name ) . '.pm'; print "Should have installed module as $install_to\n"; ok -e $install_to; @@ -65,14 +65,14 @@ ok ! $@; # Make sure there's a packlist installed - my $archdir = $build->install_destination('arch'); + my $archdir = $mb->install_destination('arch'); my ($v, $d) = File::Spec->splitpath($archdir, 1); my $packlist = File::Spec->catdir($destdir, $d, 'auto', $dist->name, '.packlist'); is -e $packlist, 1, "$packlist should be written"; } { - eval {$build->dispatch('install', installdirs => 'core', destdir => $destdir)}; + eval {$mb->dispatch('install', installdirs => 'core', destdir => $destdir)}; ok ! $@; my $libdir = strip_volume( $Config{installprivlib} ); my $install_to = File::Spec->catfile($destdir, $libdir, $dist->name ) . '.pm'; @@ -82,7 +82,7 @@ { my $libdir = File::Spec->catdir(File::Spec->rootdir, 'foo', 'bar'); - eval {$build->dispatch('install', install_path => {lib => $libdir}, destdir => $destdir)}; + eval {$mb->dispatch('install', install_path => {lib => $libdir}, destdir => $destdir)}; is $@, ''; my $install_to = File::Spec->catfile($destdir, $libdir, $dist->name ) . '.pm'; print "Should have installed module as $install_to\n"; @@ -91,7 +91,7 @@ { my $libdir = File::Spec->catdir(File::Spec->rootdir, 'foo', 'base'); - eval {$build->dispatch('install', install_base => $libdir, destdir => $destdir)}; + eval {$mb->dispatch('install', install_base => $libdir, destdir => $destdir)}; is $@, ''; my $install_to = File::Spec->catfile($destdir, $libdir, 'lib', 'perl5', $dist->name ) . '.pm'; print "Should have installed module as $install_to\n"; @@ -101,17 +101,17 @@ { # Test the ConfigData stuff - $build->config_data(foo => 'bar'); - $build->features(baz => 1); - $build->auto_features(auto_foo => {requires => {'File::Spec' => 0}}); - eval {$build->dispatch('install', destdir => $destdir)}; + $mb->config_data(foo => 'bar'); + $mb->features(baz => 1); + $mb->auto_features(auto_foo => {requires => {'File::Spec' => 0}}); + eval {$mb->dispatch('install', destdir => $destdir)}; is $@, ''; - my $libdir = strip_volume( $build->install_destination('lib') ); + my $libdir = strip_volume( $mb->install_destination('lib') ); local @INC = (@INC, File::Spec->catdir($destdir, $libdir)); eval "require @{[$dist->name]}::ConfigData"; - is $build->feature('auto_foo'), 1; + is $mb->feature('auto_foo'), 1; SKIP: { skip $@, 5 if @_; @@ -139,40 +139,40 @@ } -eval {$build->dispatch('realclean')}; +eval {$mb->dispatch('realclean')}; is $@, ''; { # Try again by running the script rather than with programmatic interface my $libdir = File::Spec->catdir('', 'foo', 'lib'); - eval {$build->run_perl_script('Build.PL', [], ['--install_path', "lib=$libdir"])}; + eval {$mb->run_perl_script('Build.PL', [], ['--install_path', "lib=$libdir"])}; is $@, ''; - eval {$build->run_perl_script('Build', [], ['install', '--destdir', $destdir])}; + eval {$mb->run_perl_script('Build', [], ['install', '--destdir', $destdir])}; is $@, ''; my $install_to = File::Spec->catfile($destdir, $libdir, $dist->name ) . '.pm'; print "# Should have installed module as $install_to\n"; ok -e $install_to; my $basedir = File::Spec->catdir('', 'bar'); - eval {$build->run_perl_script('Build', [], ['install', '--destdir', $destdir, + eval {$mb->run_perl_script('Build', [], ['install', '--destdir', $destdir, '--install_base', $basedir])}; is $@, ''; $install_to = File::Spec->catfile($destdir, $libdir, $dist->name ) . '.pm'; is -e $install_to, 1, "Look for file at $install_to"; - eval {$build->dispatch('realclean')}; + eval {$mb->dispatch('realclean')}; is $@, ''; } { # Make sure 'install_path' overrides 'install_base' - my $build = Module::Build->new( module_name => $dist->name, + my $mb = Module::Build->new( module_name => $dist->name, install_base => File::Spec->catdir('', 'foo'), install_path => {lib => File::Spec->catdir('', 'bar')}); - ok $build; - is $build->install_destination('lib'), File::Spec->catdir('', 'bar'); + ok $mb; + is $mb->install_destination('lib'), File::Spec->catdir('', 'bar'); } { @@ -191,16 +191,16 @@ # _find_file_by_type() isn't a public method, but this is currently # the only easy way to test that it works properly. - my $pods = $build->_find_file_by_type('pod', 'lib'); + my $pods = $mb->_find_file_by_type('pod', 'lib'); is keys %$pods, 1; - my $expect = $build->localize_file_path('lib/Simple/Docs.pod'); + my $expect = $mb->localize_file_path('lib/Simple/Docs.pod'); is $pods->{$expect}, $expect; - my $pms = $build->_find_file_by_type('awefawef', 'lib'); + my $pms = $mb->_find_file_by_type('awefawef', 'lib'); ok $pms; is keys %$pms, 0; - $pms = $build->_find_file_by_type('pod', 'awefawef'); + $pms = $mb->_find_file_by_type('pod', 'awefawef'); ok $pms; is keys %$pms, 0; Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- xs.t 29 Jun 2005 07:55:57 -0000 1.24 +++ xs.t 29 Jun 2005 08:27:07 -0000 1.25 @@ -15,13 +15,13 @@ { local $SIG{__WARN__} = sub {}; - my $m = Module::Build->current; - $m->verbose( 0 ); + my $mb = Module::Build->current; + $mb->verbose( 0 ); my $have_c_compiler; - stderr_of( sub {$have_c_compiler = $m->have_c_compiler} ); + stderr_of( sub {$have_c_compiler = $mb->have_c_compiler} ); - if ( ! $m->feature('C_support') ) { + if ( ! $mb->feature('C_support') ) { plan skip_all => 'C_support not enabled'; } elsif ( !$have_c_compiler ) { plan skip_all => 'C_support enabled, but no compiler found'; @@ -42,40 +42,40 @@ $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -my $m = Module::Build->new_from_context( skip_rcfile => 1 ); +my $mb = Module::Build->new_from_context( skip_rcfile => 1 ); -eval {$m->dispatch('clean')}; +eval {$mb->dispatch('clean')}; ok ! $@; -eval {$m->dispatch('build')}; +eval {$mb->dispatch('build')}; ok ! $@; { # Try again in a subprocess - eval {$m->dispatch('clean')}; + eval {$mb->dispatch('clean')}; ok ! $@; - $m->create_build_script; + $mb->create_build_script; ok -e 'Build'; - eval {$m->run_perl_script('Build')}; + eval {$mb->run_perl_script('Build')}; ok ! $@; } # We can't be verbose in the sub-test, because Test::Harness will # think that the output is for the top-level test. -eval {$m->dispatch('test')}; +eval {$mb->dispatch('test')}; ok ! $@; { - $m->dispatch('ppd', args => {codebase => '/path/to/codebase-xs'}); + $mb->dispatch('ppd', args => {codebase => '/path/to/codebase-xs'}); (my $dist_filename = $dist->name) =~ s/::/-/g; my $ppd = slurp($dist_filename . '.ppd'); - my $perl_version = Module::Build::PPMMaker->_ppd_version($m->perl_version); - my $varchname = Module::Build::PPMMaker->_varchname($m->config); + my $perl_version = Module::Build::PPMMaker->_ppd_version($mb->perl_version); + my $varchname = Module::Build::PPMMaker->_varchname($mb->config); # This test is quite a hack since with XML you don't really want to # do a strict string comparison, but absent an XML parser it's the @@ -97,17 +97,17 @@ SKIP: { skip( "skipping a couple Unixish-only tests", 2 ) - unless $m->os_type eq 'Unix'; + unless $mb->os_type eq 'Unix'; - eval {$m->dispatch('clean')}; + eval {$mb->dispatch('clean')}; ok ! $@; - local $m->{config}{ld} = "FOO=BAR $m->{config}{ld}"; - eval {$m->dispatch('build')}; + local $mb->{config}{ld} = "FOO=BAR $mb->{config}{ld}"; + eval {$mb->dispatch('build')}; ok ! $@; } -eval {$m->dispatch('realclean')}; +eval {$mb->dispatch('realclean')}; ok ! $@; # Make sure blib/ is gone after 'realclean' Index: manifypods.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/manifypods.t,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- manifypods.t 29 Jun 2005 07:50:40 -0000 1.13 +++ manifypods.t 29 Jun 2005 08:27:06 -0000 1.14 @@ -68,25 +68,25 @@ my $destdir = File::Spec->catdir($cwd, 't', 'install_test'); -my $m = Module::Build->new( +my $mb = Module::Build->new( install_base => $destdir, module_name => $dist->name, scripts => [ File::Spec->catfile( 'bin', 'nopod.pl' ), File::Spec->catfile( 'bin', 'haspod.pl' ) ], ); -$m->add_to_cleanup($destdir); +$mb->add_to_cleanup($destdir); -is( ref $m->{properties}->{bindoc_dirs}, 'ARRAY', 'bindoc_dirs' ); -is( ref $m->{properties}->{libdoc_dirs}, 'ARRAY', 'libdoc_dirs' ); +is( ref $mb->{properties}->{bindoc_dirs}, 'ARRAY', 'bindoc_dirs' ); +is( ref $mb->{properties}->{libdoc_dirs}, 'ARRAY', 'libdoc_dirs' ); my %man = ( - sep => $m->manpage_separator, + sep => $mb->manpage_separator, dir1 => 'man1', dir3 => 'man3', - ext1 => $m->{config}{man1ext}, - ext3 => $m->{config}{man3ext}, + ext1 => $mb->{config}{man1ext}, + ext3 => $mb->{config}{man3ext}, ); my %distro = ( @@ -97,26 +97,26 @@ 'lib/Simple/AllPod.pod' => "Simple$man{sep}AllPod.$man{ext3}", ); -%distro = map {$m->localize_file_path($_), $distro{$_}} keys %distro; +%distro = map {$mb->localize_file_path($_), $distro{$_}} keys %distro; -$m->dispatch('build'); +$mb->dispatch('build'); -eval {$m->dispatch('docs')}; +eval {$mb->dispatch('docs')}; ok ! $@; while (my ($from, $v) = each %distro) { if (!$v) { - ok ! $m->contains_pod($from), "$from should not contain POD"; + ok ! $mb->contains_pod($from), "$from should not contain POD"; next; } my $to = File::Spec->catfile('blib', ($from =~ /^lib/ ? 'libdoc' : 'bindoc'), $v); - ok $m->contains_pod($from), "$from should contain POD"; + ok $mb->contains_pod($from), "$from should contain POD"; ok -e $to, "Created $to manpage"; } -$m->dispatch('install'); +$mb->dispatch('install'); while (my ($from, $v) = each %distro) { next unless $v; @@ -124,7 +124,7 @@ ok -e $to, "Created $to manpage"; } -$m->dispatch('realclean'); +$mb->dispatch('realclean'); # revert to a pristine state @@ -135,20 +135,20 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -my $m2 = Module::Build->new( +my $mb2 = Module::Build->new( module_name => $dist->name, libdoc_dirs => [qw( foo bar baz )], ); -is( $m2->{properties}->{libdoc_dirs}->[0], 'foo', 'override libdoc_dirs' ); +is( $mb2->{properties}->{libdoc_dirs}->[0], 'foo', 'override libdoc_dirs' ); # Make sure we can find our own action documentation -ok $m2->get_action_docs('build'); -ok !$m2->get_action_docs('foo'); +ok $mb2->get_action_docs('build'); +ok !$mb2->get_action_docs('foo'); # Make sure those docs are the correct ones foreach ('ppd', 'disttest') { - my $docs = $m2->get_action_docs($_); + my $docs = $mb2->get_action_docs($_); like $docs, qr/=item $_/; unlike $docs, qr/\n=/, $docs; } Index: runthrough.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/runthrough.t,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- runthrough.t 29 Jun 2005 07:50:40 -0000 1.56 +++ runthrough.t 29 Jun 2005 08:27:06 -0000 1.57 @@ -72,36 +72,36 @@ ######################### -my $build = Module::Build->new_from_context; -ok $build; -is $build->license, 'perl'; +my $mb = Module::Build->new_from_context; +ok $mb; +is $mb->license, 'perl'; # Make sure cleanup files added before create_build_script() get respected -$build->add_to_cleanup('before_script'); +$mb->add_to_cleanup('before_script'); -eval {$build->create_build_script}; +eval {$mb->create_build_script}; ok ! $@; -ok -e $build->build_script; +ok -e $mb->build_script; -is $build->dist_dir, 'Simple-0.01'; +is $mb->dist_dir, 'Simple-0.01'; # The 'cleanup' file doesn't exist yet -ok grep {$_ eq 'before_script'} $build->cleanup; +ok grep {$_ eq 'before_script'} $mb->cleanup; -$build->add_to_cleanup('save_out'); +$mb->add_to_cleanup('save_out'); # The 'cleanup' file now exists -ok grep {$_ eq 'before_script'} $build->cleanup; -ok grep {$_ eq 'save_out' } $build->cleanup; +ok grep {$_ eq 'before_script'} $mb->cleanup; +ok grep {$_ eq 'save_out' } $mb->cleanup; my $output = eval { - stdout_of( sub { $build->dispatch('test', verbose => 1) } ) + stdout_of( sub { $mb->dispatch('test', verbose => 1) } ) }; ok ! $@; like $output, qr/all tests successful/i; # This is the output of lib/Simple/Script.PL -ok -e $build->localize_file_path('lib/Simple/Script'); +ok -e $mb->localize_file_path('lib/Simple/Script'); # We prefix all lines with "| " so Test::Harness doesn't get confused. @@ -113,13 +113,13 @@ SKIP: { skip( 'YAML_support feature is not enabled', 7 ) unless $have_yaml; - eval {$build->dispatch('disttest')}; + eval {$mb->dispatch('disttest')}; ok ! $@; # After a test, the distdir should contain a blib/ directory ok -e File::Spec->catdir('Simple-0.01', 'blib'); - eval {$build->dispatch('distdir')}; + eval {$mb->dispatch('distdir')}; ok ! $@; # The 'distdir' should contain a lib/ directory @@ -133,15 +133,15 @@ my $fh = IO::File->new(File::Spec->catfile($dist->dirname, 'META.yml')); my $contents = do {local $/; <$fh>}; $contents =~ /Module::Build version ([0-9_.]+)/m; - is $1, $build->VERSION, "Check version used to create META.yml: $1 == " . $build->VERSION; + is $1, $mb->VERSION, "Check version used to create META.yml: $1 == " . $mb->VERSION; SKIP: { skip( "not sure if we can create a tarball on this platform", 1 ) - unless $build->check_installed_status('Archive::Tar', 0) || - $build->isa('Module::Build::Platform::Unix'); + unless $mb->check_installed_status('Archive::Tar', 0) || + $mb->isa('Module::Build::Platform::Unix'); - $build->add_to_cleanup($build->dist_dir . ".tar.gz"); - eval {$build->dispatch('dist')}; + $mb->add_to_cleanup($mb->dist_dir . ".tar.gz"); + eval {$mb->dispatch('dist')}; ok ! $@; } @@ -149,7 +149,7 @@ { # Make sure the 'script' file was recognized as a script. - my $scripts = $build->script_files; + my $scripts = $mb->script_files; ok $scripts->{script}; # Check that a shebang line is rewritten @@ -165,7 +165,7 @@ { # Check PPD - $build->dispatch('ppd', args => {codebase => '/path/to/codebase'}); + $mb->dispatch('ppd', args => {codebase => '/path/to/codebase'}); my $ppd = slurp('Simple.ppd'); @@ -186,12 +186,12 @@ } -eval {$build->dispatch('realclean')}; +eval {$mb->dispatch('realclean')}; ok ! $@; -ok ! -e $build->build_script; -ok ! -e $build->config_dir; -ok ! -e $build->dist_dir; +ok ! -e $mb->build_script; +ok ! -e $mb->config_dir; +ok ! -e $mb->dist_dir; # cleanup Index: extend.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/extend.t,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- extend.t 29 Jun 2005 07:50:40 -0000 1.17 +++ extend.t 29 Jun 2005 08:27:06 -0000 1.18 @@ -28,19 +28,19 @@ # Here we make sure actions are only called once per dispatch() $::x = 0; -my $m = Module::Build->subclass +my $mb = Module::Build->subclass ( code => "sub ACTION_loop { die 'recursed' if \$::x++; shift->depends_on('loop'); }" )->new( module_name => $dist->name ); -ok $m; +ok $mb; -$m->dispatch('loop'); +$mb->dispatch('loop'); ok $::x; -$m->dispatch('realclean'); +$mb->dispatch('realclean'); # Make sure the subclass can be subclassed -my $build2class = ref($m)->subclass +my $build2class = ref($mb)->subclass ( code => "sub ACTION_loop2 {}", class => 'MBB', @@ -56,15 +56,15 @@ --- $dist->regen; - $m->test_files('*t*'); - my $files = $m->test_files; + $mb->test_files('*t*'); + my $files = $mb->test_files; ok grep {$_ eq 'script'} @$files; ok grep {$_ eq File::Spec->catfile('t', 'basic.t')} @$files; ok !grep {$_ eq 'Build.PL' } @$files; # Make sure order is preserved - $m->test_files('foo', 'bar'); - $files = $m->test_files; + $mb->test_files('foo', 'bar'); + $files = $mb->test_files; is @$files, 2; is $files->[0], 'foo'; is $files->[1], 'bar'; @@ -80,15 +80,15 @@ $dist->add_file( 'test.foo', "content\n" ); $dist->regen; - my $m = Module::Build->new( module_name => $dist->name, - foo_files => {'test.foo', 'lib/test.foo'} ); - ok $m; + my $mb = Module::Build->new( module_name => $dist->name, + foo_files => {'test.foo', 'lib/test.foo'} ); + ok $mb; - $m->add_build_element('foo'); - $m->dispatch('build'); - ok -e File::Spec->catfile($m->blib, 'lib', 'test.foo'); + $mb->add_build_element('foo'); + $mb->dispatch('build'); + ok -e File::Spec->catfile($mb->blib, 'lib', 'test.foo'); - $m->dispatch('realclean'); + $mb->dispatch('realclean'); # revert distribution to a pristine state $dist->remove_file( 'test.foo' ); @@ -129,34 +129,34 @@ { - ok my $m = MBSub->new( module_name => $dist->name ); - isa_ok $m, 'Module::Build'; - isa_ok $m, 'MBSub'; - ok $m->valid_property('foo'); - can_ok $m, 'module_name'; + ok my $mb = MBSub->new( module_name => $dist->name ); + isa_ok $mb, 'Module::Build'; + isa_ok $mb, 'MBSub'; + ok $mb->valid_property('foo'); + can_ok $mb, 'module_name'; # Check foo property. - can_ok $m, 'foo'; - ok ! $m->foo; - ok $m->foo(1); - ok $m->foo; + can_ok $mb, 'foo'; + ok ! $mb->foo; + ok $mb->foo(1); + ok $mb->foo; # Check bar property. - can_ok $m, 'bar'; - is $m->bar, 'hey'; - ok $m->bar('you'); - is $m->bar, 'you'; + can_ok $mb, 'bar'; + is $mb->bar, 'hey'; + ok $mb->bar('you'); + is $mb->bar, 'you'; # Check hash property. - ok $m = MBSub->new( - module_name => $dist->name, - hash => { foo => 'bar', bin => 'foo'} - ); + ok $mb = MBSub->new( + module_name => $dist->name, + hash => { foo => 'bar', bin => 'foo'} + ); - can_ok $m, 'hash'; - isa_ok $m->hash, 'HASH'; - is $m->hash->{foo}, 'bar'; - is $m->hash->{bin}, 'foo'; + can_ok $mb, 'hash'; + isa_ok $mb->hash, 'HASH'; + is $mb->hash->{foo}, 'bar'; + is $mb->hash->{bin}, 'foo'; # Check hash property passed via the command-line. { @@ -164,47 +164,45 @@ '--hash', 'foo=bar', '--hash', 'bin=foo', ); - ok $m = MBSub->new( - module_name => $dist->name, - ); + ok $mb = MBSub->new( module_name => $dist->name ); } - can_ok $m, 'hash'; - isa_ok $m->hash, 'HASH'; - is $m->hash->{foo}, 'bar'; - is $m->hash->{bin}, 'foo'; + can_ok $mb, 'hash'; + isa_ok $mb->hash, 'HASH'; + is $mb->hash->{foo}, 'bar'; + is $mb->hash->{bin}, 'foo'; # Make sure that a different subclass with the same named property has a # different default. - ok $m = MBSub2->new( module_name => $dist->name ); - isa_ok $m, 'Module::Build'; - isa_ok $m, 'MBSub2'; - ok $m->valid_property('bar'); - can_ok $m, 'bar'; - is $m->bar, 'yow'; + ok $mb = MBSub2->new( module_name => $dist->name ); + isa_ok $mb, 'Module::Build'; + isa_ok $mb, 'MBSub2'; + ok $mb->valid_property('bar'); + can_ok $mb, 'bar'; + is $mb->bar, 'yow'; } { # Test the meta_add and meta_merge stuff - ok my $m = Module::Build->new( - module_name => $dist->name, - meta_add => {foo => 'bar'}, - conflicts => {'Foo::Barxx' => 0}, - ); + ok my $mb = Module::Build->new( + module_name => $dist->name, + meta_add => {foo => 'bar'}, + conflicts => {'Foo::Barxx' => 0}, + ); my %data; - $m->prepare_metadata( \%data ); + $mb->prepare_metadata( \%data ); is $data{foo}, 'bar'; - $m->meta_merge(foo => 'baz'); - $m->prepare_metadata( \%data ); + $mb->meta_merge(foo => 'baz'); + $mb->prepare_metadata( \%data ); is $data{foo}, 'baz'; - $m->meta_merge(conflicts => {'Foo::Fooxx' => 0}); - $m->prepare_metadata( \%data ); + $mb->meta_merge(conflicts => {'Foo::Fooxx' => 0}); + $mb->prepare_metadata( \%data ); is_deeply $data{conflicts}, {'Foo::Barxx' => 0, 'Foo::Fooxx' => 0}; - $m->meta_add(conflicts => {'Foo::Bazxx' => 0}); - $m->prepare_metadata( \%data ); + $mb->meta_add(conflicts => {'Foo::Bazxx' => 0}); + $mb->prepare_metadata( \%data ); is_deeply $data{conflicts}, {'Foo::Bazxx' => 0, 'Foo::Fooxx' => 0}; } Index: notes.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/notes.t,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- notes.t 29 Jun 2005 07:50:40 -0000 1.13 +++ notes.t 29 Jun 2005 08:27:06 -0000 1.14 @@ -32,34 +32,34 @@ $dist->regen; -my $m = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context; -is $m->notes('foo'), 'bar'; +is $mb->notes('foo'), 'bar'; # Try setting & checking a new value -$m->notes(argh => 'new'); -is $m->notes('argh'), 'new'; +$mb->notes(argh => 'new'); +is $mb->notes('argh'), 'new'; # Change existing value -$m->notes(foo => 'foo'); -is $m->notes('foo'), 'foo'; +$mb->notes(foo => 'foo'); +is $mb->notes('foo'), 'foo'; # Change back so we can run this test again successfully -$m->notes(foo => 'bar'); -is $m->notes('foo'), 'bar'; +$mb->notes(foo => 'bar'); +is $mb->notes('foo'), 'bar'; ################################### # Make sure notes set before create_build_script() get preserved -$m = Module::Build->new(module_name => $dist->name); -ok $m; -$m->notes(foo => 'bar'); -is $m->notes('foo'), 'bar'; +$mb = Module::Build->new(module_name => $dist->name); +ok $mb; +$mb->notes(foo => 'bar'); +is $mb->notes('foo'), 'bar'; -$m->create_build_script; +$mb->create_build_script; -$m = Module::Build->resume; -ok $m; -is $m->notes('foo'), 'bar'; +$mb = Module::Build->resume; +ok $mb; +is $mb->notes('foo'), 'bar'; # cleanup Index: basic.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/basic.t,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- basic.t 29 Jun 2005 07:50:40 -0000 1.42 +++ basic.t 29 Jun 2005 08:27:06 -0000 1.43 @@ -31,16 +31,16 @@ # Test object creation { - my $m = Module::Build->new( module_name => $dist->name ); - ok $m; - is $m->module_name, $dist->name; - is $m->build_class, 'Module::Build'; - is $m->dist_name, $dist->name; + my $mb = Module::Build->new( module_name => $dist->name ); + ok $mb; + is $mb->module_name, $dist->name; + is $mb->build_class, 'Module::Build'; + is $mb->dist_name, $dist->name; - $m = Module::Build->new( dist_name => $dist->name, dist_version => 7 ); - ok $m; - ok ! $m->module_name; # Make sure it's defined - is $m->dist_name, $dist->name; + $mb = Module::Build->new( dist_name => $dist->name, dist_version => 7 ); + ok $mb; + ok ! $mb->module_name; # Make sure it's defined + is $mb->dist_name, $dist->name; } # Make sure actions are defined, and known_actions works as class method @@ -55,27 +55,27 @@ local @INC = (File::Spec->catdir( $dist->dirname, 'lib' ), @INC); my $flagged = 0; local $SIG{__WARN__} = sub { $flagged = 1 if $_[0] =~ /@{[$dist->name]}/}; - my $m = Module::Build->new( + my $mb = Module::Build->new( module_name => $dist->name, requires => {$dist->name => 0}, ); ok ! $flagged; - ok ! $m->prereq_failures; - $m->dispatch('realclean'); + ok ! $mb->prereq_failures; + $mb->dispatch('realclean'); $dist->clean; $flagged = 0; - $m = Module::Build->new( + $mb = Module::Build->new( module_name => $dist->name, requires => {$dist->name => 3.14159265}, ); ok $flagged; - ok $m->prereq_failures; - ok $m->prereq_failures->{requires}{$dist->name}; - is $m->prereq_failures->{requires}{$dist->name}{have}, 0.01; - is $m->prereq_failures->{requires}{$dist->name}{need}, 3.14159265; + ok $mb->prereq_failures; + ok $mb->prereq_failures->{requires}{$dist->name}; + is $mb->prereq_failures->{requires}{$dist->name}{have}, 0.01; + is $mb->prereq_failures->{requires}{$dist->name}{need}, 3.14159265; - $m->dispatch('realclean'); + $mb->dispatch('realclean'); $dist->clean; # Make sure check_installed_status() works as a class method @@ -102,7 +102,7 @@ my $flagged = 0; local $SIG{__WARN__} = sub { $flagged = 1 if $_[0] =~ /ModuleBuildNonExistent isn't installed/}; - my $m = Module::Build->new( + my $mb = Module::Build->new( module_name => $dist->name, recommends => {ModuleBuildNonExistent => 3}, ); @@ -112,14 +112,14 @@ # Test verbosity { - my $m = Module::Build->new(module_name => $dist->name); + my $mb = Module::Build->new(module_name => $dist->name); - $m->add_to_cleanup('save_out'); + $mb->add_to_cleanup('save_out'); # Use uc() so we don't confuse the current test output - like uc(stdout_of( sub {$m->dispatch('test', verbose => 1)} )), qr/^OK \d/m; - like uc(stdout_of( sub {$m->dispatch('test', verbose => 0)} )), qr/\.\.OK/; + like uc(stdout_of( sub {$mb->dispatch('test', verbose => 1)} )), qr/^OK \d/m; + like uc(stdout_of( sub {$mb->dispatch('test', verbose => 0)} )), qr/\.\.OK/; - $m->dispatch('realclean'); + $mb->dispatch('realclean'); $dist->clean; } @@ -149,32 +149,32 @@ eval {Module::Build->run_perl_script('Build.PL', [], ['skip_rcfile=1', '--config', "foocakes=barcakes", '--foo', '--bar', '--bar', '-bat=hello', 'gee=whiz', '--any', 'hey', '--destdir', 'yo', '--verbose', '1'])}; ok ! $@; - my $m = Module::Build->resume; - is $m->config->{cc}, $Config{cc}; - is $m->config->{foocakes}, 'barcakes'; + my $mb = Module::Build->resume; + is $mb->config->{cc}, $Config{cc}; + is $mb->config->{foocakes}, 'barcakes'; # Test args(). - is $m->args('foo'), 1; - is $m->args('bar'), 2, 'bar'; - is $m->args('bat'), 'hello', 'bat'; - is $m->args('gee'), 'whiz'; - is $m->args('any'), 'hey'; - is $m->args('dee'), 'goo'; - is $m->destdir, 'yo'; - is $m->runtime_params('destdir'), 'yo'; - is $m->runtime_params('verbose'), '1'; - ok ! $m->runtime_params('license'); - ok my %runtime = $m->runtime_params; + is $mb->args('foo'), 1; + is $mb->args('bar'), 2, 'bar'; + is $mb->args('bat'), 'hello', 'bat'; + is $mb->args('gee'), 'whiz'; + is $mb->args('any'), 'hey'; + is $mb->args('dee'), 'goo'; + is $mb->destdir, 'yo'; + is $mb->runtime_params('destdir'), 'yo'; + is $mb->runtime_params('verbose'), '1'; + ok ! $mb->runtime_params('license'); + ok my %runtime = $mb->runtime_params; is scalar keys %runtime, 4; is $runtime{destdir}, 'yo'; is $runtime{verbose}, '1'; ok $runtime{config}; - ok my $argsref = $m->args; + ok my $argsref = $mb->args; is $argsref->{foo}, 1; $argsref->{doo} = 'hee'; - is $m->args('doo'), 'hee'; - ok my %args = $m->args; + is $mb->args('doo'), 'hee'; + ok my %args = $mb->args; is $args{foo}, 1; # revert test distribution to pristine state because we modified a file @@ -187,15 +187,15 @@ # Test author stuff { - my $m = Module::Build->new( + my $mb = Module::Build->new( module_name => $dist->name, dist_author => 'Foo Meister <fo...@ex...>', build_class => 'My::Big::Fat::Builder', ); - ok $m; - ok ref($m->dist_author), 'dist_author converted to array if simple string'; - is $m->dist_author->[0], 'Foo Meister <fo...@ex...>'; - is $m->build_class, 'My::Big::Fat::Builder'; + ok $mb; + ok ref($mb->dist_author), 'dist_author converted to array if simple string'; + is $mb->dist_author->[0], 'Foo Meister <fo...@ex...>'; + is $mb->build_class, 'My::Big::Fat::Builder'; } Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- destinations.t 29 Jun 2005 07:50:40 -0000 1.21 +++ destinations.t 29 Jun 2005 08:27:06 -0000 1.22 @@ -33,25 +33,25 @@ } use Module::Build; -my $M = Module::Build->new_from_context; -isa_ok( $M, 'Module::Build::Base' ); +my $mb = Module::Build->new_from_context; +isa_ok( $mb, 'Module::Build::Base' ); -my $Install_Sets = $M->install_sets; +my $install_sets = $mb->install_sets; # Get us into a known state. -$M->installdirs('site'); -$M->install_base(undef); -$M->prefix(undef); +$mb->installdirs('site'); +$mb->install_base(undef); +$mb->prefix(undef); # Check that we install into the proper default locations. { - is( $M->installdirs, 'site' ); - is( $M->install_base, undef ); - is( $M->prefix, undef ); + is( $mb->installdirs, 'site' ); + is( $mb->install_base, undef ); + is( $mb->prefix, undef ); - test_install_destinations( $M, { + test_install_destinations( $mb, { lib => $Config{installsitelib}, arch => $Config{installsitearch}, bin => $Config{installsitebin} || $Config{installbin}, @@ -65,10 +65,10 @@ # Is installdirs honored? { - $M->installdirs('core'); - is( $M->installdirs, 'core' ); + $mb->installdirs('core'); + is( $mb->installdirs, 'core' ); - test_install_destinations( $M, { + test_install_destinations( $mb, { lib => $Config{installprivlib}, arch => $Config{installarchlib}, bin => $Config{installbin}, @@ -77,21 +77,21 @@ libdoc => $Config{installman3dir}, }); - $M->installdirs('site'); - is( $M->installdirs, 'site' ); + $mb->installdirs('site'); + is( $mb->installdirs, 'site' ); } # Check install_base() { my $install_base = catdir( 'foo', 'bar' ); - $M->install_base( $install_base ); + $mb->install_base( $install_base ); - is( $M->prefix, undef ); - is( $M->install_base, $install_base ); + is( $mb->prefix, undef ); + is( $mb->install_base, $install_base ); - test_install_destinations( $M, { + test_install_destinations( $mb, { lib => catdir( $install_base, 'lib', 'perl5' ), arch => catdir( $install_base, 'lib', 'perl5', $Config{archname} ), bin => catdir( $install_base, 'bin' ), @@ -104,27 +104,27 @@ # Basic prefix test. Ensure everything is under the prefix. { - $M->install_base( undef ); - ok( !defined $M->install_base ); + $mb->install_base( undef ); + ok( !defined $mb->install_base ); my $prefix = catdir( qw( some prefix ) ); - $M->prefix( $prefix ); - is( $M->{properties}{prefix}, $prefix ); + $mb->prefix( $prefix ); + is( $mb->{properties}{prefix}, $prefix ); - test_prefix($prefix, $Install_Sets->{site}); + test_prefix($prefix, $install_sets->{site}); } # And now that prefix honors installdirs. { - $M->installdirs('core'); - is( $M->installdirs, 'core' ); + $mb->installdirs('core'); + is( $mb->installdirs, 'core' ); my $prefix = catdir( qw( some prefix ) ); test_prefix($prefix); - $M->installdirs('site'); - is( $M->installdirs, 'site' ); + $mb->installdirs('site'); + is( $mb->installdirs, 'site' ); } @@ -132,7 +132,7 @@ # the prefix. Ensure it doesn't. { # Get the prefix defaults - my $defaults = $M->prefix_relpaths('site'); + my $defaults = $mb->prefix_relpaths('site'); # Create a configuration involving weird paths that are outside of # the configured prefix. @@ -151,14 +151,14 @@ # Poke at the innards of MB to change the default install locations. while( my($key, $path) = each %test_config ) { - $M->{properties}{install_sets}{site}{$key} = $path; + $mb->{properties}{install_sets}{site}{$key} = $path; } - $M->{config}{siteprefixexp} = catdir(File::Spec->rootdir, + $mb->{config}{siteprefixexp} = catdir(File::Spec->rootdir, 'wierd', 'prefix'); my $prefix = catdir('another', 'prefix'); - $M->prefix($prefix); + $mb->prefix($prefix); test_prefix($prefix, \%test_config); } @@ -166,9 +166,9 @@ # Check that we can use install_base after setting prefix. { my $install_base = catdir( 'foo', 'bar' ); - $M->install_base( $install_base ); + $mb->install_base( $install_base ); - test_install_destinations( $M, { + test_install_destinations( $mb, { lib => catdir( $install_base, 'lib', 'perl5' ), arch => catdir( $install_base, 'lib', 'perl5', $Config{archname} ), bin => catdir( $install_base, 'bin' ), @@ -190,7 +190,7 @@ local $Test::Builder::Level = $Test::Builder::Level + 1; foreach my $type (qw(lib arch bin script bindoc libdoc)) { - my $dest = $M->install_destination( $type ); + my $dest = $mb->install_destination( $type ); like( $dest, "/^\Q$prefix\E/", "$type prefixed"); if( $test_config ) { @@ -199,18 +199,17 @@ is( $dest_dirs[-1], $test_dirs[-1], ' suffix correctish' ); } - } } sub test_install_destinations { - my($mb, $expect) = @_; + my($build, $expect) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; while( my($type, $expect) = each %$expect ) { - is( $mb->install_destination($type), $expect, "$type destination" ); + is( $build->install_destination($type), $expect, "$type destination" ); } } |
|
From: Randy W. S. <si...@us...> - 2005-06-29 07:56:06
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv817/t/lib Modified Files: DistGen.pm Log Message: Abbreviate parameter 'xs_module' to simply 'xs'. Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- DistGen.pm 29 Jun 2005 07:46:41 -0000 1.8 +++ DistGen.pm 29 Jun 2005 07:55:58 -0000 1.9 @@ -24,7 +24,7 @@ my %data = ( skip_manifest => 0, - xs_module => 0, + xs => 0, %options, ); my $self = bless( \%data, $package ); @@ -60,7 +60,7 @@ my $module_filename = join( '/', ('lib', split(/::/, $self->{name})) ) . '.pm'; - unless ( $self->{xs_module} ) { + unless ( $self->{xs} ) { $self->add_file( $module_filename, <<"---" ) unless $self->{filedata}{$module_filename}; package $self->{name}; @@ -368,7 +368,7 @@ The directory in which to create the distribution directory. The default is File::Spec->curdir. -=item xs_module +=item xs Generates an XS based module. |
|
From: Randy W. S. <si...@us...> - 2005-06-29 07:56:06
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv817/t Modified Files: xs.t Log Message: Abbreviate parameter 'xs_module' to simply 'xs'. Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- xs.t 29 Jun 2005 07:50:41 -0000 1.23 +++ xs.t 29 Jun 2005 07:55:57 -0000 1.24 @@ -38,7 +38,7 @@ my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new( dir => $tmp, xs_module => 1 ); +my $dist = DistGen->new( dir => $tmp, xs => 1 ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; |
|
From: Randy W. S. <si...@us...> - 2005-06-29 07:50:50
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30273/t Modified Files: basic.t compat.t destinations.t extend.t files.t install.t manifypods.t moduleinfo.t notes.t runthrough.t signature.t tilde.t versions.t xs.t Log Message: Create test distributions a temporary directory in 't/_tmp', and clean it up when done. Index: files.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/files.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- files.t 28 Jun 2005 07:33:32 -0000 1.6 +++ files.t 29 Jun 2005 07:50:40 -0000 1.7 @@ -8,9 +8,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -56,3 +57,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: signature.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/signature.t,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- signature.t 28 Jun 2005 05:02:26 -0000 1.10 +++ signature.t 29 Jun 2005 07:50:41 -0000 1.11 @@ -25,9 +25,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->change_file( 'Build.PL', <<"---" ); use Module::Build; @@ -82,3 +83,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: moduleinfo.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/moduleinfo.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- moduleinfo.t 28 Jun 2005 07:31:23 -0000 1.7 +++ moduleinfo.t 29 Jun 2005 07:50:40 -0000 1.8 @@ -13,9 +13,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -114,7 +115,7 @@ # revert to pristine state chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; -$dist = DistGen->new; +$dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -153,7 +154,7 @@ # revert to pristine state chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; -$dist = DistGen->new; +$dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -275,3 +276,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: basic.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/basic.t,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- basic.t 29 Jun 2005 05:13:13 -0000 1.41 +++ basic.t 29 Jun 2005 07:50:40 -0000 1.42 @@ -13,9 +13,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -179,7 +180,7 @@ # revert test distribution to pristine state because we modified a file chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; - $dist = DistGen->new; + $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; } @@ -201,3 +202,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- compat.t 29 Jun 2005 05:13:13 -0000 1.29 +++ compat.t 29 Jun 2005 07:50:40 -0000 1.30 @@ -32,9 +32,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -197,3 +198,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: install.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/install.t,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- install.t 28 Jun 2005 07:25:20 -0000 1.20 +++ install.t 29 Jun 2005 07:50:40 -0000 1.21 @@ -13,9 +13,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -206,7 +207,7 @@ # revert to pristine state chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; - $dist = DistGen->new; + $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; } @@ -221,3 +222,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- xs.t 28 Jun 2005 07:33:32 -0000 1.22 +++ xs.t 29 Jun 2005 07:50:41 -0000 1.23 @@ -35,9 +35,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new( xs_module => 1 ); +my $dist = DistGen->new( dir => $tmp, xs_module => 1 ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -116,3 +117,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: manifypods.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/manifypods.t,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- manifypods.t 28 Jun 2005 09:40:50 -0000 1.12 +++ manifypods.t 29 Jun 2005 07:50:40 -0000 1.13 @@ -24,10 +24,10 @@ use Cwd (); my $cwd = Cwd::cwd; - +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->add_file( 'bin/nopod.pl', <<'---' ); #!perl -w print "sample script without pod to test manifypods action\n"; @@ -130,7 +130,7 @@ # revert to a pristine state chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; -$dist = DistGen->new; +$dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -157,3 +157,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: runthrough.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/runthrough.t,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- runthrough.t 29 Jun 2005 05:13:13 -0000 1.55 +++ runthrough.t 29 Jun 2005 07:50:40 -0000 1.56 @@ -17,9 +17,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->remove_file( 't/basic.t' ); $dist->change_file( 'Build.PL', <<'---' ); use Module::Build; @@ -196,3 +197,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: extend.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/extend.t,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- extend.t 29 Jun 2005 05:13:13 -0000 1.16 +++ extend.t 29 Jun 2005 07:50:40 -0000 1.17 @@ -13,9 +13,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -211,3 +212,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: versions.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/versions.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- versions.t 28 Jun 2005 07:33:32 -0000 1.6 +++ versions.t 29 Jun 2005 07:50:41 -0000 1.7 @@ -5,8 +5,12 @@ use Test::More tests => 2; +use Cwd (); +my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); + use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; ######################### @@ -23,3 +27,6 @@ # cleanup $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: notes.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/notes.t,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- notes.t 28 Jun 2005 07:33:32 -0000 1.12 +++ notes.t 29 Jun 2005 07:50:40 -0000 1.13 @@ -8,9 +8,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -64,3 +65,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- tilde.t 28 Jun 2005 07:33:32 -0000 1.9 +++ tilde.t 29 Jun 2005 07:50:41 -0000 1.10 @@ -15,9 +15,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -81,3 +82,6 @@ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- destinations.t 28 Jun 2005 03:03:17 -0000 1.20 +++ destinations.t 29 Jun 2005 07:50:40 -0000 1.21 @@ -13,9 +13,10 @@ use Cwd (); my $cwd = Cwd::cwd; +my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); use DistGen; -my $dist = DistGen->new; +my $dist = DistGen->new( dir => $tmp ); $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; @@ -216,3 +217,6 @@ chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; + +use File::Path; +rmtree( $tmp ); |
|
From: Randy W. S. <si...@us...> - 2005-06-29 07:46:50
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28058/t/lib Modified Files: DistGen.pm Log Message: Remove any existing distribution at creation, assuming it is the remains from a test that died prematurely. Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- DistGen.pm 28 Jun 2005 06:26:32 -0000 1.7 +++ DistGen.pm 29 Jun 2005 07:46:41 -0000 1.8 @@ -29,6 +29,11 @@ ); my $self = bless( \%data, $package ); + if ( -d $self->dirname ) { + warn "Warning: Removing existing directory at '@{[$self->dirname]}'\n"; + $self->remove; + } + $self->_gen_default_filedata(); return $self; |
|
From: Randy W. S. <si...@us...> - 2005-06-29 07:13:18
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11844/t Modified Files: common.pl Log Message: Remove unused subs that provided support for the 'Test' module that is no longer used. Index: common.pl =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/common.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- common.pl 12 Apr 2005 20:09:42 -0000 1.12 +++ common.pl 29 Jun 2005 07:12:53 -0000 1.13 @@ -9,28 +9,12 @@ push @INC, $t_lib; # Let user's installed version override } -use Test(); sub have_module { my $module = shift; return eval "use $module; 1"; } -sub need_module { - my $module = shift; - skip_test("$module not installed") unless have_module($module); -} - -sub skip_test { - my $msg = @_ ? shift() : ''; - print "1..0 # Skipped: $msg\n"; - exit; -} - -sub skip_subtest { - my $msg = @_ ? shift() : '(no reason given)'; - Test::skip "skip $msg", 1; -} sub save_handle { my ($handle, $subr) = @_; |
|
From: Randy W. S. <si...@us...> - 2005-06-29 07:02:00
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7409 Modified Files: Build.PL Log Message: Change build requirement from 'Test' to 'Test::More', using bundled version of 'Test::More'. Index: Build.PL =================================================================== RCS file: /cvsroot/module-build/Module-Build/Build.PL,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- Build.PL 26 Jun 2005 17:54:04 -0000 1.56 +++ Build.PL 29 Jun 2005 07:01:34 -0000 1.57 @@ -3,7 +3,8 @@ # On some platforms (*ahem*, MacPerl 5.6.1) "use lib qw(lib);" doesn't # find the local "lib" directory, so we use File::Spec to do it properly. use File::Spec; -use lib File::Spec->catdir('lib'); +use lib File::Spec->catdir('lib'); # use our self to install +use lib File::Spec->catdir('t', 'lib'); # use bundled Test::More # We use Module::Build to test & install itself. use Module::Build; @@ -44,7 +45,7 @@ 'Module::Signature' => 0.21, }, build_requires => { - Test => 0, + 'Test::More' => 0, }, sign => 1, create_readme => 1, |
|
From: Randy W. S. <si...@us...> - 2005-06-29 06:39:08
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28720/lib/Module/Build Modified Files: Base.pm Log Message: Only add 'version' lines to the 'provides' key in META.yml if a version is defined. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.450 retrieving revision 1.451 diff -u -d -r1.450 -r1.451 --- Base.pm 27 Jun 2005 19:51:31 -0000 1.450 +++ Base.pm 29 Jun 2005 06:38:59 -0000 1.451 @@ -2600,7 +2600,8 @@ foreach my $package ($pm_info->packages_inside($localfile)) { $out{$package}{file} = $dist_files{$file}; - $out{$package}{version} = $pm_info->version( $package ); + $out{$package}{version} = $pm_info->version( $package ) + if defined( $pm_info->version( $package ) ); } } return \%out; |
|
From: Randy W. S. <si...@us...> - 2005-06-29 05:13:22
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22173/t Modified Files: basic.t compat.t extend.t runthrough.t Log Message: Correct a few unixisms. Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- compat.t 28 Jun 2005 07:33:32 -0000 1.28 +++ compat.t 29 Jun 2005 05:13:13 -0000 1.29 @@ -150,7 +150,7 @@ $output = stdout_of( sub { $ran_ok = $build->do_system(@make, 'test', 'TEST_VERBOSE=0') } ); ok $ran_ok; $output =~ s/^/# /gm; # Don't confuse our own test output - like $output, qr/(?:# t[\/\w]+\.+ok\s+(?:[\d.]s\s*)?)+# All tests/, + like $output, qr/(?:# .+basic\.+ok\s+(?:[\d.]s\s*)?)+# All tests/, 'Should be non-verbose'; $build->delete_filetree($libdir); Index: basic.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/basic.t,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- basic.t 28 Jun 2005 02:57:24 -0000 1.40 +++ basic.t 29 Jun 2005 05:13:13 -0000 1.41 @@ -25,7 +25,7 @@ use_ok 'Module::Build'; -like $INC{'Module/Build.pm'}, qr|/blib/|, "Make sure Module::Build was loaded from blib/"; +like $INC{'Module/Build.pm'}, qr/\bblib\b/, "Make sure Module::Build was loaded from blib/"; # Test object creation Index: runthrough.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/runthrough.t,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- runthrough.t 28 Jun 2005 10:02:38 -0000 1.54 +++ runthrough.t 29 Jun 2005 05:13:13 -0000 1.55 @@ -67,7 +67,7 @@ use Module::Build; ok(1); -like $INC{'Module/Build.pm'}, qr{/blib/}, "Make sure version from blib/ is loaded"; +like $INC{'Module/Build.pm'}, qr/\bblib\b/, "Make sure version from blib/ is loaded"; ######################### Index: extend.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/extend.t,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- extend.t 28 Jun 2005 06:27:52 -0000 1.15 +++ extend.t 29 Jun 2005 05:13:13 -0000 1.16 @@ -58,7 +58,7 @@ $m->test_files('*t*'); my $files = $m->test_files; ok grep {$_ eq 'script'} @$files; - ok grep {$_ eq 't/basic.t'} @$files; + ok grep {$_ eq File::Spec->catfile('t', 'basic.t')} @$files; ok !grep {$_ eq 'Build.PL' } @$files; # Make sure order is preserved |