[Module-build-checkins] Module-Build/t common.pl,1.13,1.14 compat.t,1.33,1.34 destinations.t,1.33,1.
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <si...@us...> - 2005-10-20 16:45:31
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20639/t Modified Files: common.pl compat.t destinations.t files.t install.t metadata.t metadata2.t notes.t parents.t runthrough.t signature.t tilde.t versions.t xs.t Log Message: Added support for environment variable, 'MODULEBUILDRC', which can be used to specify the full path to an option file to use instead of the default location of ~/.modulebuildrc. A special undocumented setting of 'NONE' tells Module::Build not to load any user settings, so tests can be run without tainting from user options. The primary motivation for this feature is to make it easy to construct tests without needing to pass in an option to disable reading the rcfile for every Module::Build object created. Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- destinations.t 20 Oct 2005 09:26:42 -0000 1.33 +++ destinations.t 20 Oct 2005 16:45:19 -0000 1.34 @@ -28,7 +28,7 @@ ######################### use Module::Build; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; isa_ok( $mb, 'Module::Build::Base' ); my $install_sets = $mb->install_sets; Index: signature.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/signature.t,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- signature.t 20 Oct 2005 09:26:42 -0000 1.14 +++ signature.t 20 Oct 2005 16:45:19 -0000 1.15 @@ -47,7 +47,7 @@ use Module::Build; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; { Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- compat.t 20 Oct 2005 09:26:42 -0000 1.33 +++ compat.t 20 Oct 2005 16:45:19 -0000 1.34 @@ -53,7 +53,7 @@ ######################### -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; ok $mb; foreach my $type (@makefile_types) { @@ -94,7 +94,7 @@ # Make sure custom builder subclass is used in the created # Makefile.PL - make sure it fails in the right way here. local @Foo::Builder::ISA = qw(Module::Build); - my $foo_builder = Foo::Builder->new_from_context( use_rcfile => 0 ); + my $foo_builder = Foo::Builder->new_from_context; foreach my $style ('passthrough', 'small') { Module::Build::Compat->create_makefile_pl($style, $foo_builder); ok -e 'Makefile.PL'; @@ -109,7 +109,7 @@ } # Now make sure it can actually work. - my $bar_builder = Module::Build->subclass( class => 'Bar::Builder' )->new_from_context( use_rcfile => 0 ); + my $bar_builder = Module::Build->subclass( class => 'Bar::Builder' )->new_from_context; foreach my $style ('passthrough', 'small') { Module::Build::Compat->create_makefile_pl($style, $bar_builder); ok -e 'Makefile.PL'; @@ -124,7 +124,6 @@ my $libdir = File::Spec->catdir( $cwd, 't', 'libdir' ); my $result = $mb->run_perl_script('Makefile.PL', [], [ - 'USE_RCFILE=0', "LIB=$libdir", 'TEST_VERBOSE=1', 'INSTALLDIRS=perl', Index: install.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/install.t,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- install.t 20 Oct 2005 09:26:42 -0000 1.26 +++ install.t 20 Oct 2005 16:45:19 -0000 1.27 @@ -44,7 +44,7 @@ --- $dist->regen; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; ok $mb; Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- xs.t 20 Oct 2005 09:26:42 -0000 1.31 +++ xs.t 20 Oct 2005 16:45:19 -0000 1.32 @@ -42,7 +42,7 @@ $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; eval {$mb->dispatch('clean')}; Index: files.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/files.t,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- files.t 20 Oct 2005 09:26:42 -0000 1.10 +++ files.t 20 Oct 2005 16:45:19 -0000 1.11 @@ -5,6 +5,9 @@ use Test::More tests => 6; +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); +require $common_pl; use Cwd (); my $cwd = Cwd::cwd; @@ -17,12 +20,11 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -use File::Spec; use IO::File; use Module::Build; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; my @files; { Index: runthrough.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/runthrough.t,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- runthrough.t 20 Oct 2005 09:26:42 -0000 1.59 +++ runthrough.t 20 Oct 2005 16:45:19 -0000 1.60 @@ -72,7 +72,7 @@ ######################### -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; ok $mb; is $mb->license, 'perl'; Index: versions.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/versions.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- versions.t 29 Jun 2005 07:50:41 -0000 1.7 +++ versions.t 20 Oct 2005 16:45:19 -0000 1.8 @@ -5,6 +5,10 @@ use Test::More tests => 2; +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' ); @@ -16,7 +20,6 @@ ######################### use Module::Build; -use File::Spec; my @mod = split( /::/, $dist->name ); my $file = File::Spec->catfile( $dist->dirname, 'lib', @mod ) . '.pm'; Index: parents.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/parents.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- parents.t 28 Jun 2005 03:51:40 -0000 1.2 +++ parents.t 20 Oct 2005 16:45:19 -0000 1.3 @@ -5,6 +5,10 @@ use Test::More tests => 27; +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); +require $common_pl; + ######################### Index: notes.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/notes.t,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- notes.t 20 Oct 2005 09:26:42 -0000 1.15 +++ notes.t 20 Oct 2005 16:45:19 -0000 1.16 @@ -5,6 +5,9 @@ use Test::More tests => 8; +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); +require $common_pl; use Cwd (); my $cwd = Cwd::cwd; @@ -32,7 +35,7 @@ $dist->regen; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; is $mb->notes('foo'), 'bar'; Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- tilde.t 20 Oct 2005 09:26:42 -0000 1.12 +++ tilde.t 20 Oct 2005 16:45:19 -0000 1.13 @@ -35,7 +35,7 @@ my $mb; stdout_of( sub { - $mb = Module::Build->new_from_context( @args, use_rcfile => 0 ); + $mb = Module::Build->new_from_context( @args ); } ); return $mb; Index: common.pl =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/common.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- common.pl 29 Jun 2005 07:12:53 -0000 1.13 +++ common.pl 20 Oct 2005 16:45:19 -0000 1.14 @@ -1,12 +1,16 @@ use strict; use Config; -# In case the test wants to use Test::More or our other bundled -# modules, make sure they can be loaded. They'll still do "use -# Test::More" in the test script. BEGIN { + + # In case the test wants to use Test::More or our other bundled + # modules, make sure they can be loaded. They'll still do "use + # Test::More" in the test script. my $t_lib = File::Spec->catdir('t', 'lib'); push @INC, $t_lib; # Let user's installed version override + + # Make sure none of our tests load the users ~/.modulebuildrc file + $ENV{MODULEBUILDRC} = 'NONE'; } Index: metadata2.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata2.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- metadata2.t 20 Oct 2005 09:26:42 -0000 1.3 +++ metadata2.t 20 Oct 2005 16:45:19 -0000 1.4 @@ -28,7 +28,7 @@ ok ! -e 'MANIFEST'; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; my $out; $out = eval { stderr_of(sub{$mb->dispatch('distmeta')}) }; @@ -96,7 +96,7 @@ --- $dist->regen( clean => 1 ); ok( -e "lib/Simple.pm", "Creating Simple.pm" ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $mb->dispatch('distmeta'); like( _slurp("README"), qr/NAME/, "Generating README from .pm"); @@ -117,7 +117,7 @@ ok( -e "lib/Simple.pm", "Creating Simple.pm" ); ok( -e "lib/Simple.pod", "Creating Simple.pod" ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $mb->dispatch('distmeta'); like( _slurp("README"), qr/NAME/, "Generating README from .pod"); is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', @@ -142,7 +142,7 @@ $dist->regen( clean => 1 ); ok( -e "lib/Simple.pm", "Creating Simple.pm" ); ok( -e "lib/Simple.pod", "Creating Simple.pod" ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $mb->dispatch('distmeta'); like( _slurp("README"), qr/NAME/, "Generating README from .pod over .pm"); is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', Index: metadata.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- metadata.t 20 Oct 2005 09:26:42 -0000 1.6 +++ metadata.t 20 Oct 2005 16:45:19 -0000 1.7 @@ -32,7 +32,7 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; use Module::Build; -my $mb = Module::Build->new_from_context( use_rcfile => 0 ); +my $mb = Module::Build->new_from_context; my $provides; # Used a bunch of times below ############################## Single Module @@ -45,7 +45,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => {file => 'lib/Simple.pm', version => '1.23'}}); @@ -54,7 +54,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => {file => 'lib/Simple.pm'}}); @@ -66,7 +66,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Foo::Bar' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -75,7 +75,7 @@ package Foo::Bar; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Foo::Bar' => { file => 'lib/Simple.pm'}}); @@ -91,7 +91,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }, @@ -110,7 +110,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple.pm', version => '1.23' }, @@ -128,7 +128,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm' }}); @@ -144,7 +144,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -161,7 +161,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -179,9 +179,7 @@ --- $dist->regen( clean => 1 ); my $err = ''; -$err = stderr_of( sub { - $mb = Module::Build->new_from_context( use_rcfile => 0 ) -} ); +$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -200,9 +198,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$err = stderr_of( sub { - $mb = Module::Build->new_from_context( use_rcfile => 0 ); -} ); +$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Foo' => { file => 'lib/Simple.pm', @@ -224,7 +220,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -242,7 +238,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -262,7 +258,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple2.pm', version => '1.23' }}); @@ -282,7 +278,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -305,7 +301,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -329,7 +325,7 @@ package Foo; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; ok( exists( $provides->{Foo} ) ); # it exist, can't predict which file $dist->remove_file( 'lib/Simple2.pm' ); @@ -347,7 +343,7 @@ package Foo; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -366,7 +362,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple2.pm', version => '1.23' }}); @@ -386,7 +382,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); # XXX Should 'Foo' exist ??? Can't predict values for file & version ok( exists( $provides->{Foo} ) ); @@ -408,7 +404,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( exists( $provides->{Foo} ) ); is( $provides->{Foo}{version}, '1.23' ); @@ -434,7 +430,7 @@ --- $dist->regen( clean => 1 ); $err = stderr_of( sub { - $mb = Module::Build->new_from_context( use_rcfile => 0 ); + $mb = Module::Build->new_from_context; } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, @@ -460,7 +456,7 @@ --- $dist->regen( clean => 1 ); $err = stderr_of( sub { - $mb = Module::Build->new_from_context( use_rcfile => 0 ); + $mb = Module::Build->new_from_context; } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, @@ -486,7 +482,7 @@ $VERSION = '3.45'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -499,7 +495,7 @@ $dist->change_file( 'lib/Simple.pm', '' ); $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply( $mb->find_dist_packages, {} ); # Simple.pm => =pod..=cut (no package declaration) @@ -517,7 +513,7 @@ =cut --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context( use_rcfile => 0 ); +$mb = Module::Build->new_from_context; is_deeply($mb->find_dist_packages, {}); |