[Module-build-checkins] Module-Build/t basic.t,1.46,1.47 compat.t,1.32,1.33 destinations.t,1.32,1.33
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <si...@us...> - 2005-10-20 09:27:05
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10734/t Modified Files: basic.t compat.t destinations.t files.t install.t metadata.t metadata2.t notes.t runthrough.t signature.t tilde.t xs.t Log Message: Changing to a more positive outlook, we change the option 'skip_rcfile' to 'use_rcfile'. Fix a bug in the option translation code that didn't properly translate dashes to underscores when the option was an invertered boolean (i.e. an option beginning with 'no' or 'no-'). Modify tests so that Module::Build objects are constructed with 'use_rcfile' set to false so that user resource files do not interfere with tests. Add brief documentation to describe Global commandline options. Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- destinations.t 3 Oct 2005 18:19:03 -0000 1.32 +++ destinations.t 20 Oct 2005 09:26:42 -0000 1.33 @@ -28,7 +28,7 @@ ######################### use Module::Build; -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); 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.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- signature.t 2 Oct 2005 05:26:07 -0000 1.13 +++ signature.t 20 Oct 2005 09:26:42 -0000 1.14 @@ -47,7 +47,7 @@ use Module::Build; -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); { Index: basic.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/basic.t,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- basic.t 3 Oct 2005 08:45:05 -0000 1.46 +++ basic.t 20 Oct 2005 09:26:42 -0000 1.47 @@ -146,7 +146,7 @@ --- $dist->regen; - 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'])}; + eval {Module::Build->run_perl_script('Build.PL', [], ['--nouse-rcfile', '--config', "foocakes=barcakes", '--foo', '--bar', '--bar', '-bat=hello', 'gee=whiz', '--any', 'hey', '--destdir', 'yo', '--verbose', '1'])}; is $@, ''; my $mb = Module::Build->resume; Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- compat.t 2 Oct 2005 05:26:07 -0000 1.32 +++ compat.t 20 Oct 2005 09:26:42 -0000 1.33 @@ -53,7 +53,7 @@ ######################### -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); 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(); + my $foo_builder = Foo::Builder->new_from_context( use_rcfile => 0 ); 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; + my $bar_builder = Module::Build->subclass( class => 'Bar::Builder' )->new_from_context( use_rcfile => 0 ); foreach my $style ('passthrough', 'small') { Module::Build::Compat->create_makefile_pl($style, $bar_builder); ok -e 'Makefile.PL'; @@ -124,7 +124,7 @@ my $libdir = File::Spec->catdir( $cwd, 't', 'libdir' ); my $result = $mb->run_perl_script('Makefile.PL', [], [ - 'SKIP_RCFILE=1', + '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.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- install.t 3 Oct 2005 18:19:03 -0000 1.25 +++ install.t 20 Oct 2005 09:26:42 -0000 1.26 @@ -44,7 +44,7 @@ --- $dist->regen; -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); ok $mb; Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- xs.t 20 Oct 2005 04:45:01 -0000 1.30 +++ xs.t 20 Oct 2005 09:26:42 -0000 1.31 @@ -42,7 +42,7 @@ $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -my $mb = Module::Build->new_from_context( skip_rcfile => 1 ); +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); eval {$mb->dispatch('clean')}; Index: files.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/files.t,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- files.t 20 Sep 2005 02:11:28 -0000 1.9 +++ files.t 20 Oct 2005 09:26:42 -0000 1.10 @@ -22,7 +22,7 @@ use Module::Build; -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); my @files; { Index: runthrough.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/runthrough.t,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- runthrough.t 2 Oct 2005 05:26:07 -0000 1.58 +++ runthrough.t 20 Oct 2005 09:26:42 -0000 1.59 @@ -72,7 +72,7 @@ ######################### -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); ok $mb; is $mb->license, 'perl'; @@ -113,7 +113,9 @@ SKIP: { skip( 'YAML_support feature is not enabled', 7 ) unless $have_yaml; - eval {$mb->dispatch('disttest')}; + my $output = eval { + stdout_of( sub { $mb->dispatch('disttest') } ) + }; is $@, ''; # After a test, the distdir should contain a blib/ directory Index: notes.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/notes.t,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- notes.t 29 Jun 2005 08:27:06 -0000 1.14 +++ notes.t 20 Oct 2005 09:26:42 -0000 1.15 @@ -32,7 +32,7 @@ $dist->regen; -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); is $mb->notes('foo'), 'bar'; Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- tilde.t 28 Jul 2005 07:29:22 -0000 1.11 +++ tilde.t 20 Oct 2005 09:26:42 -0000 1.12 @@ -35,7 +35,7 @@ my $mb; stdout_of( sub { - $mb = Module::Build->new_from_context( @args ); + $mb = Module::Build->new_from_context( @args, use_rcfile => 0 ); } ); return $mb; Index: metadata2.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata2.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- metadata2.t 20 Oct 2005 03:40:48 -0000 1.2 +++ metadata2.t 20 Oct 2005 09:26:42 -0000 1.3 @@ -28,7 +28,7 @@ ok ! -e 'MANIFEST'; -my $mb = Module::Build->new_from_context; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- metadata.t 28 Jul 2005 07:53:32 -0000 1.5 +++ metadata.t 20 Oct 2005 09:26:42 -0000 1.6 @@ -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; +my $mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); 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; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -179,7 +179,9 @@ --- $dist->regen( clean => 1 ); my $err = ''; -$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); +$err = stderr_of( sub { + $mb = Module::Build->new_from_context( use_rcfile => 0 ) +} ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -198,7 +200,9 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); +$err = stderr_of( sub { + $mb = Module::Build->new_from_context( use_rcfile => 0 ); +} ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Foo' => { file => 'lib/Simple.pm', @@ -220,7 +224,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -238,7 +242,7 @@ package Simple; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -258,7 +262,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple2.pm', version => '1.23' }}); @@ -278,7 +282,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -301,7 +305,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -325,7 +329,7 @@ package Foo; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $provides = $mb->find_dist_packages; ok( exists( $provides->{Foo} ) ); # it exist, can't predict which file $dist->remove_file( 'lib/Simple2.pm' ); @@ -343,7 +347,7 @@ package Foo; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -362,7 +366,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {'Foo' => { file => 'lib/Simple2.pm', version => '1.23' }}); @@ -382,7 +386,7 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); # XXX Should 'Foo' exist ??? Can't predict values for file & version ok( exists( $provides->{Foo} ) ); @@ -404,7 +408,7 @@ $VERSION = '1.23'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); ok( exists( $provides->{Foo} ) ); is( $provides->{Foo}{version}, '1.23' ); @@ -429,7 +433,9 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); +$err = stderr_of( sub { + $mb = Module::Build->new_from_context( use_rcfile => 0 ); +} ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -453,7 +459,9 @@ $VERSION = '2.34'; --- $dist->regen( clean => 1 ); -$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); +$err = stderr_of( sub { + $mb = Module::Build->new_from_context( use_rcfile => 0 ); +} ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => 'lib/Simple.pm', @@ -478,7 +486,7 @@ $VERSION = '3.45'; --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {'Simple' => { file => 'lib/Simple.pm', version => '1.23' }}); @@ -491,7 +499,7 @@ $dist->change_file( 'lib/Simple.pm', '' ); $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply( $mb->find_dist_packages, {} ); # Simple.pm => =pod..=cut (no package declaration) @@ -509,7 +517,7 @@ =cut --- $dist->regen( clean => 1 ); -$mb = Module::Build->new_from_context; +$mb = Module::Build->new_from_context( use_rcfile => 0 ); is_deeply($mb->find_dist_packages, {}); |