module-build-checkins Mailing List for Module::Build (Page 24)
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-06-28 03:03:25
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13584/t Modified Files: destinations.t Log Message: Add some TODO tests Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- destinations.t 23 Jun 2005 08:32:33 -0000 1.19 +++ destinations.t 28 Jun 2005 03:03:17 -0000 1.20 @@ -3,7 +3,7 @@ use lib 't/lib'; use strict; -use Test::More tests => 66; +use Test::More tests => 68; use File::Spec (); @@ -24,6 +24,12 @@ use Config; use File::Spec::Functions qw( catdir splitdir ); +######################### + +TODO: { + local $TODO = 'Test PREFIX pass-thru to compat Makefile.PL'; + ok 0, 'PREFIX'; +} use Module::Build; my $M = Module::Build->new_from_context; @@ -172,6 +178,11 @@ } +TODO: { + local $TODO = "install paths not defined."; + ok 0, '(bin|lib)doc install destination'; +} + sub test_prefix { my ($prefix, $test_config) = @_; |
|
From: Randy W. S. <si...@us...> - 2005-06-28 02:57:33
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10217/t Modified Files: basic.t Log Message: Fix potential precedence errors introduced in previous change (not vs !). Index: basic.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/basic.t,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- basic.t 28 Jun 2005 00:38:47 -0000 1.39 +++ basic.t 28 Jun 2005 02:57:24 -0000 1.40 @@ -13,7 +13,6 @@ use Cwd (); my $cwd = Cwd::cwd; -my $t_lib = File::Spec->catdir( $cwd, 't', 'lib' ); use DistGen; my $dist = DistGen->new; @@ -39,7 +38,7 @@ $m = Module::Build->new( dist_name => $dist->name, dist_version => 7 ); ok $m; - ok not $m->module_name; # Make sure it's defined + ok ! $m->module_name; # Make sure it's defined is $m->dist_name, $dist->name; } @@ -59,8 +58,8 @@ module_name => $dist->name, requires => {$dist->name => 0}, ); - ok not $flagged; - ok not $m->prereq_failures; + ok ! $flagged; + ok ! $m->prereq_failures; $m->dispatch('realclean'); $dist->clean; @@ -147,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'])}; - ok not $@; + ok ! $@; my $m = Module::Build->resume; is $m->config->{cc}, $Config{cc}; @@ -163,7 +162,7 @@ is $m->destdir, 'yo'; is $m->runtime_params('destdir'), 'yo'; is $m->runtime_params('verbose'), '1'; - ok not $m->runtime_params('license'); + ok ! $m->runtime_params('license'); ok my %runtime = $m->runtime_params; is scalar keys %runtime, 4; is $runtime{destdir}, 'yo'; |
|
From: Randy W. S. <si...@us...> - 2005-06-28 02:56:06
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9505/t Modified Files: compat.t Log Message: use Test::More Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- compat.t 27 Jun 2005 18:51:38 -0000 1.25 +++ compat.t 28 Jun 2005 02:55:43 -0000 1.26 @@ -1,35 +1,50 @@ +#!/usr/bin/perl -w + +use lib 't/lib'; use strict; -use Test; + +use Test::More; + + +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); +require $common_pl; + + +use Cwd (); +my $cwd = Cwd::cwd; + use Module::Build; use Module::Build::Compat; -use File::Spec; + use File::Path; use Config; -my $common_pl = File::Spec->catfile('t', 'common.pl'); -require $common_pl; - use Carp; $SIG{__WARN__} = \&Carp::cluck; +######################### + # Don't let our own verbosity/test_file get mixed up with our subprocess's my @makefile_keys = qw(TEST_VERBOSE HARNESS_VERBOSE TEST_FILES MAKEFLAGS); local @ENV{@makefile_keys}; delete @ENV{@makefile_keys}; -skip_test("Don't know how to invoke 'make'") - unless $Config{make} and find_in_path($Config{make}); - my @makefile_types = qw(small passthrough traditional); my $tests_per_type = 10; -plan tests => 30 + @makefile_types*$tests_per_type; +if ( $Config{make} && find_in_path($Config{make}) ) { + plan tests => 30 + @makefile_types*$tests_per_type; +} else { + plan skip_all => "Don't know how to invoke 'make'"; +} ok(1); # Loaded -my @make = $Config{make} eq 'nmake' ? ('nmake', '-nologo') : ($Config{make}); +######################### -my $startdir = Module::Build->cwd; -my $goto = File::Spec->catdir( $startdir, 't', 'Sample' ); +my @make = $Config{make} eq 'nmake' ? ('nmake', '-nologo') : ($Config{make}); + +my $goto = File::Spec->catdir( $cwd, 't', 'Sample' ); chdir $goto or die "can't chdir to $goto: $!"; my $build = Module::Build->new_from_context; @@ -47,7 +62,7 @@ $success = $build->do_system(@make, 'test'); } ); ok $success; - ok uc $output, qr{DONE\.|SUCCESS}; + like uc $output, qr{DONE\.|SUCCESS}; ok $build->do_system(@make, 'realclean'); @@ -55,7 +70,7 @@ test_makefile_creation($build, [], 'INSTALLDIRS=vendor', 1); 1 while unlink 'Makefile.PL'; - ok (! -e 'Makefile.PL', 1); + ok ! -e 'Makefile.PL'; } { @@ -64,9 +79,9 @@ my $warning = ''; local $SIG{__WARN__} = sub { $warning = shift; }; my $maketext = eval { Module::Build::Compat->fake_makefile(makefile => 'Makefile') }; - ok $@, ''; - ok $maketext, qr/^realclean/m; - ok $warning, qr/build_class/; + ok ! $@; + like $maketext, qr/^realclean/m; + like $warning, qr/build_class/; } { @@ -82,9 +97,9 @@ my $warning = stderr_of (sub { my $result = $build->run_perl_script('Makefile.PL'); - ok !$result; + ok ! $result; }); - ok $warning, qr{Foo/Builder.pm}; + like $warning, qr{Foo/Builder.pm}; } # Now make sure it can actually work. @@ -100,7 +115,7 @@ # Make sure various Makefile.PL arguments are supported Module::Build::Compat->create_makefile_pl('passthrough', $build); - my $libdir = File::Spec->catdir( $startdir, 't', 'libdir' ); + my $libdir = File::Spec->catdir( $cwd, 't', 'libdir' ); my $result = $build->run_perl_script('Makefile.PL', [], [ 'SKIP_RCFILE=1', @@ -111,35 +126,35 @@ ] ); ok $result; - ok -e 'Build.PL', 1; + ok -e 'Build.PL'; my $new_build = Module::Build->resume(); - ok $new_build->installdirs, 'core'; - ok $new_build->verbose, 1; - ok $new_build->install_destination('lib'), $libdir; - ok $new_build->extra_compiler_flags->[0], '-DPERL_POLLUTE'; + is $new_build->installdirs, 'core'; + is $new_build->verbose, 1; + is $new_build->install_destination('lib'), $libdir; + is $new_build->extra_compiler_flags->[0], '-DPERL_POLLUTE'; # Make sure those switches actually had an effect my ($ran_ok, $output); $output = stdout_of( sub { $ran_ok = $new_build->do_system(@make, 'test') } ); ok $ran_ok; $output =~ s/^/# /gm; # Don't confuse our own test output - ok $output, qr/# ok 1\s+# ok 2\s+/, 'Should be verbose'; + like $output, qr/# ok 1\s+# ok 2\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') } ); ok $ran_ok; $output =~ s/^/# /gm; # Don't confuse our own test output - ok $output, qr/# test\.+ok\s+(?:[\d.]s\s*)?# All tests/, 'Should be non-verbose'; + like $output, qr/# test\.+ok\s+(?:[\d.]s\s*)?# All tests/, 'Should be non-verbose'; $build->delete_filetree($libdir); - ok (! -e $libdir, 1, "Sample installation directory should be cleaned up"); - + ok ! -e $libdir, "Sample installation directory should be cleaned up"; + $build->do_system(@make, 'realclean'); - ok (! -e 'Makefile', 1, "Makefile shouldn't exist"); + ok ! -e 'Makefile', "Makefile shouldn't exist"; 1 while unlink 'Makefile.PL'; - ok (! -e 'Makefile.PL', 1); + ok ! -e 'Makefile.PL'; } { # Make sure tilde-expansion works @@ -152,7 +167,7 @@ $build->run_perl_script('Makefile.PL', [], ['INSTALL_BASE=~/foo']); my $b2 = Module::Build->current; ok $b2->install_base; - ok $b2->install_base !~ /^~/, 1, "Tildes should be expanded"; + unlike $b2->install_base, qr/^~/, "Tildes should be expanded"; $build->do_system(@make, 'realclean'); 1 while unlink 'Makefile.PL'; @@ -164,10 +179,10 @@ my $result = $build->run_perl_script('Makefile.PL', $preargs, $postargs); ok $result; - ok -e 'Makefile', 1, "Makefile should exist"; + ok -e 'Makefile', "Makefile should exist"; if ($cleanup) { $build->do_system(@make, 'realclean'); - ok (! -e 'Makefile', 1, "Makefile shouldn't exist"); + ok ! -e 'Makefile', "Makefile shouldn't exist"; } } |
|
From: Randy W. S. <si...@us...> - 2005-06-28 00:39:09
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31017/t Modified Files: basic.t Log Message: Use the DistGen module for tests. Index: basic.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/basic.t,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- basic.t 27 Jun 2005 23:24:32 -0000 1.38 +++ basic.t 28 Jun 2005 00:38:47 -0000 1.39 @@ -13,6 +13,13 @@ use Cwd (); my $cwd = Cwd::cwd; +my $t_lib = File::Spec->catdir( $cwd, 't', 'lib' ); + +use DistGen; +my $dist = DistGen->new; +$dist->regen; + +chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; ######################### @@ -21,20 +28,19 @@ like $INC{'Module/Build.pm'}, qr|/blib/|, "Make sure Module::Build was loaded from blib/"; -chdir( 't' ) or die "Can't chdir to 't': $!"; # Test object creation { - my $build = new Module::Build( module_name => 'ModuleBuildOne' ); - ok $build; - is $build->module_name, 'ModuleBuildOne'; - is $build->build_class, 'Module::Build'; - is $build->dist_name, 'ModuleBuildOne'; - - $build = Module::Build->new( dist_name => 'ModuleBuildOne', dist_version => 7 ); - ok $build; - is $build->module_name, ''; # Make sure it's defined - is $build->dist_name, 'ModuleBuildOne'; + 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; + + $m = Module::Build->new( dist_name => $dist->name, dist_version => 7 ); + ok $m; + ok not $m->module_name; # Make sure it's defined + is $m->dist_name, $dist->name; } # Make sure actions are defined, and known_actions works as class method @@ -46,31 +52,31 @@ # Test prerequisite checking { - local @INC = (@INC, 'lib'); + local @INC = (File::Spec->catdir( $dist->dirname, 'lib' ), @INC); my $flagged = 0; - local $SIG{__WARN__} = sub { $flagged = 1 if $_[0] =~ /ModuleBuildOne/}; - my $m = new Module::Build - ( - module_name => 'ModuleBuildOne', - requires => {ModuleBuildOne => 0}, - ); - ok !$flagged; - ok !$m->prereq_failures; + local $SIG{__WARN__} = sub { $flagged = 1 if $_[0] =~ /@{[$dist->name]}/}; + my $m = Module::Build->new( + module_name => $dist->name, + requires => {$dist->name => 0}, + ); + ok not $flagged; + ok not $m->prereq_failures; $m->dispatch('realclean'); + $dist->clean; $flagged = 0; - $m = new Module::Build - ( - module_name => 'ModuleBuildOne', - requires => {ModuleBuildOne => 3}, - ); + $m = Module::Build->new( + module_name => $dist->name, + requires => {$dist->name => 3.14159265}, + ); ok $flagged; ok $m->prereq_failures; - ok $m->prereq_failures->{requires}{ModuleBuildOne}; - is $m->prereq_failures->{requires}{ModuleBuildOne}{have}, 0.01; - is $m->prereq_failures->{requires}{ModuleBuildOne}{need}, 3; + 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; $m->dispatch('realclean'); + $dist->clean; # Make sure check_installed_status() works as a class method my $info = Module::Build->check_installed_status('File::Spec', 0); @@ -80,7 +86,7 @@ # Make sure check_installed_status() works with an advanced spec $info = Module::Build->check_installed_status('File::Spec', '> 0'); ok $info->{ok}; - + # Use 2 lines for this, to avoid a "used only once" warning local $Foo::Module::VERSION; $Foo::Module::VERSION = '1.01_02'; @@ -93,86 +99,106 @@ { # Make sure the correct warning message is generated when an # optional prereq isn't installed - my $flagged = 0; local $SIG{__WARN__} = sub { $flagged = 1 if $_[0] =~ /ModuleBuildNonExistent isn't installed/}; - my $m = new Module::Build - ( - module_name => 'ModuleBuildOne', - recommends => {ModuleBuildNonExistent => 3}, - ); + my $m = Module::Build->new( + module_name => $dist->name, + recommends => {ModuleBuildNonExistent => 3}, + ); ok $flagged; + $dist->clean; } # Test verbosity { - my $cwd = Cwd::cwd(); - - chdir 'Sample'; - my $m = new Module::Build(module_name => 'Sample'); + my $m = Module::Build->new(module_name => $dist->name); $m->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 2/m; + 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/; - + $m->dispatch('realclean'); - chdir $cwd or die "Can't change back to $cwd: $!"; + $dist->clean; } # Make sure 'config' entries are respected on the command line, and that # Getopt::Long specs work as expected. { - my $cwd = Cwd::cwd(); use Config; - - chdir 'Sample'; + $dist->change_file( 'Build.PL', <<"---" ); +use Module::Build; + +my \$build = Module::Build->new( + module_name => @{[$dist->name]}, + license => 'perl', + get_options => { foo => {}, + bar => { type => '+' }, + bat => { type => '=s' }, + dee => { type => '=s', + default => 'goo' + }, + } +); +\$build->create_build_script; +--- + + $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'])}; ok not $@; - - my $b = Module::Build->resume(); - is $b->config->{cc}, $Config{cc}; - is $b->config->{foocakes}, 'barcakes'; + + my $m = Module::Build->resume; + is $m->config->{cc}, $Config{cc}; + is $m->config->{foocakes}, 'barcakes'; # Test args(). - is $b->args('foo'), 1; - is $b->args('bar'), 2, 'bar'; - is $b->args('bat'), 'hello', 'bat'; - is $b->args('gee'), 'whiz'; - is $b->args('any'), 'hey'; - is $b->args('dee'), 'goo'; - is $b->destdir, 'yo'; - is $b->runtime_params('destdir'), 'yo'; - is $b->runtime_params('verbose'), '1'; - ok not $b->runtime_params('license'); - ok my %runtime = $b->runtime_params; + 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 not $m->runtime_params('license'); + ok my %runtime = $m->runtime_params; is scalar keys %runtime, 4; is $runtime{destdir}, 'yo'; is $runtime{verbose}, '1'; ok $runtime{config}; - ok my $argsref = $b->args; + ok my $argsref = $m->args; is $argsref->{foo}, 1; $argsref->{doo} = 'hee'; - is $b->args('doo'), 'hee'; - ok my %args = $b->args; + is $m->args('doo'), 'hee'; + ok my %args = $m->args; is $args{foo}, 1; - chdir $cwd or die "Can't change back to $cwd: $!"; + # 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->regen; + chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; } # Test author stuff { - my $build = new Module::Build - ( - module_name => 'ModuleBuildOne', - dist_author => 'Foo Meister <fo...@ex...>', - build_class => 'My::Big::Fat::Builder', - ); - ok $build; - ok ref($build->dist_author); - is $build->dist_author->[0], 'Foo Meister <fo...@ex...>'; - is $build->build_class, 'My::Big::Fat::Builder'; + my $m = 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'; } + + +# cleanup +chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; +$dist->remove; |
|
From: Randy W. S. <si...@us...> - 2005-06-27 23:24:41
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24195/t Modified Files: basic.t Log Message: use Test::More Index: basic.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/basic.t,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- basic.t 31 Mar 2005 09:40:14 -0000 1.37 +++ basic.t 27 Jun 2005 23:24:32 -0000 1.38 @@ -1,42 +1,47 @@ -######################### We start with some black magic to print on failure. +#!/usr/bin/perl -w +use lib 't/lib'; use strict; -use Test; -BEGIN { plan tests => 52 } -use Module::Build; -ok(1); -use File::Spec; -use Cwd; +use Test::More tests => 52; -my $common_pl = File::Spec->catfile('t', 'common.pl'); + +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); require $common_pl; -######################### End of black magic. -ok $INC{'Module/Build.pm'}, '/blib/', "Make sure Module::Build was loaded from blib/"; +use Cwd (); +my $cwd = Cwd::cwd; -chdir 't'; +######################### + + +use_ok 'Module::Build'; + +like $INC{'Module/Build.pm'}, qr|/blib/|, "Make sure Module::Build was loaded from blib/"; + +chdir( 't' ) or die "Can't chdir to 't': $!"; # Test object creation { my $build = new Module::Build( module_name => 'ModuleBuildOne' ); ok $build; - ok $build->module_name, 'ModuleBuildOne'; - ok $build->build_class, 'Module::Build'; - ok $build->dist_name, 'ModuleBuildOne'; + is $build->module_name, 'ModuleBuildOne'; + is $build->build_class, 'Module::Build'; + is $build->dist_name, 'ModuleBuildOne'; $build = Module::Build->new( dist_name => 'ModuleBuildOne', dist_version => 7 ); ok $build; - ok $build->module_name, ''; # Make sure it's defined - ok $build->dist_name, 'ModuleBuildOne'; + is $build->module_name, ''; # Make sure it's defined + is $build->dist_name, 'ModuleBuildOne'; } # Make sure actions are defined, and known_actions works as class method { my %actions = map {$_, 1} Module::Build->known_actions; - ok $actions{clean}, 1; - ok $actions{distdir}, 1; + ok $actions{clean}; + ok $actions{distdir}; } # Test prerequisite checking @@ -49,7 +54,7 @@ module_name => 'ModuleBuildOne', requires => {ModuleBuildOne => 0}, ); - ok $flagged, 0; + ok !$flagged; ok !$m->prereq_failures; $m->dispatch('realclean'); @@ -59,29 +64,29 @@ module_name => 'ModuleBuildOne', requires => {ModuleBuildOne => 3}, ); - ok $flagged, 1; + ok $flagged; ok $m->prereq_failures; ok $m->prereq_failures->{requires}{ModuleBuildOne}; - ok $m->prereq_failures->{requires}{ModuleBuildOne}{have}, 0.01; - ok $m->prereq_failures->{requires}{ModuleBuildOne}{need}, 3; + is $m->prereq_failures->{requires}{ModuleBuildOne}{have}, 0.01; + is $m->prereq_failures->{requires}{ModuleBuildOne}{need}, 3; $m->dispatch('realclean'); # Make sure check_installed_status() works as a class method my $info = Module::Build->check_installed_status('File::Spec', 0); - ok $info->{ok}, 1; - ok $info->{have}, $File::Spec::VERSION; + ok $info->{ok}; + is $info->{have}, $File::Spec::VERSION; # Make sure check_installed_status() works with an advanced spec $info = Module::Build->check_installed_status('File::Spec', '> 0'); - ok $info->{ok}, 1; + ok $info->{ok}; # Use 2 lines for this, to avoid a "used only once" warning local $Foo::Module::VERSION; $Foo::Module::VERSION = '1.01_02'; $info = Module::Build->check_installed_status('Foo::Module', '1.01_02'); - ok $info->{ok}, 1; + ok $info->{ok}; print "# $info->{message}\n" if $info->{message}; } @@ -109,8 +114,8 @@ $m->add_to_cleanup('save_out'); # Use uc() so we don't confuse the current test output - ok uc(stdout_of( sub {$m->dispatch('test', verbose => 1)} )), qr/^OK 2/m; - ok uc(stdout_of( sub {$m->dispatch('test', verbose => 0)} )), qr/\.\.OK/; + like uc(stdout_of( sub {$m->dispatch('test', verbose => 1)} )), qr/^OK 2/m; + like uc(stdout_of( sub {$m->dispatch('test', verbose => 0)} )), qr/\.\.OK/; $m->dispatch('realclean'); chdir $cwd or die "Can't change back to $cwd: $!"; @@ -125,35 +130,35 @@ chdir 'Sample'; 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 $@, ''; + ok not $@; my $b = Module::Build->resume(); - ok $b->config->{cc}, $Config{cc}; - ok $b->config->{foocakes}, 'barcakes'; + is $b->config->{cc}, $Config{cc}; + is $b->config->{foocakes}, 'barcakes'; # Test args(). - ok $b->args('foo'), 1; - ok $b->args('bar'), 2, 'bar'; - ok $b->args('bat'), 'hello', 'bat'; - ok $b->args('gee'), 'whiz'; - ok $b->args('any'), 'hey'; - ok $b->args('dee'), 'goo'; - ok $b->destdir, 'yo'; - ok $b->runtime_params('destdir'), 'yo'; - ok $b->runtime_params('verbose'), '1'; - ok !$b->runtime_params('license'); + is $b->args('foo'), 1; + is $b->args('bar'), 2, 'bar'; + is $b->args('bat'), 'hello', 'bat'; + is $b->args('gee'), 'whiz'; + is $b->args('any'), 'hey'; + is $b->args('dee'), 'goo'; + is $b->destdir, 'yo'; + is $b->runtime_params('destdir'), 'yo'; + is $b->runtime_params('verbose'), '1'; + ok not $b->runtime_params('license'); ok my %runtime = $b->runtime_params; - ok scalar keys %runtime, 4; - ok $runtime{destdir}, 'yo'; - ok $runtime{verbose}, '1'; + is scalar keys %runtime, 4; + is $runtime{destdir}, 'yo'; + is $runtime{verbose}, '1'; ok $runtime{config}; ok my $argsref = $b->args; - ok $argsref->{foo}, 1; + is $argsref->{foo}, 1; $argsref->{doo} = 'hee'; - ok $b->args('doo'), 'hee'; + is $b->args('doo'), 'hee'; ok my %args = $b->args; - ok $args{foo}, 1; + is $args{foo}, 1; chdir $cwd or die "Can't change back to $cwd: $!"; } @@ -168,6 +173,6 @@ ); ok $build; ok ref($build->dist_author); - ok $build->dist_author->[0], 'Foo Meister <fo...@ex...>'; - ok $build->build_class, 'My::Big::Fat::Builder'; + is $build->dist_author->[0], 'Foo Meister <fo...@ex...>'; + is $build->build_class, 'My::Big::Fat::Builder'; } |
|
From: Ken W. <kwi...@us...> - 2005-06-27 19:51:53
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv324 Modified Files: Base.pm Log Message: Simplify the prefix_relative() code and put the failure handling in _prefixify(). Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.449 retrieving revision 1.450 diff -u -d -r1.449 -r1.450 --- Base.pm 26 Jun 2005 15:38:15 -0000 1.449 +++ Base.pm 27 Jun 2005 19:51:31 -0000 1.450 @@ -2643,11 +2643,7 @@ my ($self, $type) = @_; my $installdirs = $self->installdirs; - # XXX the 'return' here is not a very good failure mechanism - my $normal_location = $self->install_sets->{$installdirs}{$type} - or return; - - return $self->_prefixify($normal_location, + return $self->_prefixify($self->install_sets->{$installdirs}{$type}, $self->original_prefix->{$installdirs}, $type, ); @@ -2678,7 +2674,9 @@ $self->log_verbose(" prefixify $path from $sprefix to $rprefix\n"); if( length $path == 0 ) { - $self->log_verbose(" no path to prefixify.\n") + $self->log_verbose(" no path to prefixify.\n"); + # XXX the 'return' here is not a very good failure mechanism + return; } elsif( !File::Spec->file_name_is_absolute($path) ) { $self->log_verbose(" path is relative, not prefixifying.\n"); } elsif( $sprefix eq $rprefix ) { |
|
From: Ken W. <kwi...@us...> - 2005-06-27 18:54:33
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8375 Modified Files: Changes Log Message: Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.354 retrieving revision 1.355 diff -u -d -r1.354 -r1.355 --- Changes 23 Jun 2005 00:21:49 -0000 1.354 +++ Changes 27 Jun 2005 18:54:25 -0000 1.355 @@ -54,6 +54,10 @@ supported for quite a while as arguments to "perl Makefile.PL"). [Requested by Guillaume Rousse] + - Test::Harness has changed its output format in recent versions, + which threw off one of our tests. We now allow for this different + format. [Reported by Scott Godin] + 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-06-27 18:51:51
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7103/t Modified Files: compat.t Log Message: Be more robust to differences in Test::Harness output Index: compat.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/compat.t,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- compat.t 8 Jun 2005 04:13:15 -0000 1.24 +++ compat.t 27 Jun 2005 18:51:38 -0000 1.25 @@ -130,7 +130,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 - ok $output, qr/# test\.+ok\s+# All/, 'Should be non-verbose'; + ok $output, qr/# test\.+ok\s+(?:[\d.]s\s*)?# All tests/, 'Should be non-verbose'; $build->delete_filetree($libdir); ok (! -e $libdir, 1, "Sample installation directory should be cleaned up"); |
|
From: Ken W. <kwi...@us...> - 2005-06-26 17:54:15
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2489 Modified Files: Build.PL Log Message: Be more robust to differences in Test::Harness output Index: Build.PL =================================================================== RCS file: /cvsroot/module-build/Module-Build/Build.PL,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- Build.PL 23 Jun 2005 08:20:22 -0000 1.55 +++ Build.PL 26 Jun 2005 17:54:04 -0000 1.56 @@ -34,6 +34,7 @@ 'Cwd' => 0, 'Text::ParseWords' => 0, 'Getopt::Long' => 0, + 'Test::Harness' => 0, }, recommends => { 'Archive::Tar' => '1.08', |
|
From: Ken W. <kwi...@us...> - 2005-06-26 15:38:26
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build/Platform In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26614/lib/Module/Build/Platform Modified Files: VMS.pm Log Message: _prefixify() clearly doesn't work for VMS, but let's at least get it to compile. Index: VMS.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/VMS.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VMS.pm 21 Jun 2005 22:49:30 -0000 1.8 +++ VMS.pm 26 Jun 2005 15:38:16 -0000 1.9 @@ -75,8 +75,9 @@ =cut # Translated from ExtUtils::MM_VMS::prefixify() -sub prefixify { - my($self, $path, $sprefix, $rprefix) = @_; +sub _prefixify { + my($self, $path, $sprefix, $type) = @_; + my $rprefix = $self->prefix; $self->log_verbose(" prefixify $path from $sprefix to $rprefix\n"); @@ -99,15 +100,16 @@ } else { my($path_vol, $path_dirs) = File::Spec->splitpath( $path ); - if( $path_vol eq $Config{vms_prefix}.':' ) { - $self->log_verbose(" $Config{vms_prefix}: seen\n"); + my $vms_prefix = $self->config->{vms_prefix}; + if( $path_vol eq $vms_prefix.':' ) { + $self->log_verbose(" $vms_prefix: seen\n"); $path_dirs =~ s{^\[}{\[.} unless $path_dirs =~ m{^\[\.}; $path = $self->_catprefix($rprefix, $path_dirs); } else { $self->log_verbose(" cannot prefixify.\n"); - $path = $self->_prefixify_default($rprefix, $default); + return $self->prefix_relpaths($self->installdirs, $type); } } |
|
From: Ken W. <kwi...@us...> - 2005-06-26 15:38:26
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26614/lib/Module/Build Modified Files: Base.pm Log Message: _prefixify() clearly doesn't work for VMS, but let's at least get it to compile. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.448 retrieving revision 1.449 diff -u -d -r1.448 -r1.449 --- Base.pm 26 Jun 2005 15:16:11 -0000 1.448 +++ Base.pm 26 Jun 2005 15:38:15 -0000 1.449 @@ -2649,7 +2649,6 @@ return $self->_prefixify($normal_location, $self->original_prefix->{$installdirs}, - $self->prefix, $type, ); } @@ -2671,7 +2670,8 @@ # Translated from ExtUtils::MM_Unix::prefixify() sub _prefixify { - my($self, $path, $sprefix, $rprefix, $type) = @_; + my($self, $path, $sprefix, $type) = @_; + my $rprefix = $self->prefix; $rprefix .= '/' if $sprefix =~ m|/$|; |
|
From: Ken W. <kwi...@us...> - 2005-06-26 15:16:20
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15409/lib/Module/Build Modified Files: Base.pm Log Message: Avoid catting just to uncat again Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.447 retrieving revision 1.448 diff -u -d -r1.447 -r1.448 --- Base.pm 25 Jun 2005 20:40:30 -0000 1.447 +++ Base.pm 26 Jun 2005 15:16:11 -0000 1.448 @@ -2683,7 +2683,7 @@ $self->log_verbose(" path is relative, not prefixifying.\n"); } elsif( $sprefix eq $rprefix ) { $self->log_verbose(" no new prefix.\n"); - } elsif( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s ) { + } elsif( $path !~ s{^\Q$sprefix\E\b}{}s ) { $self->log_verbose(" cannot prefixify, falling back to default.\n"); my $default = $self->prefix_relpaths($self->installdirs, $type); if( !$default ) { @@ -2694,13 +2694,9 @@ return $default; } - $self->log_verbose(" now $path\n"); - - # Return a path relative to $rprefix (this is kind of silly for now, - # because the caller is just going to cat them back together again, - # but prefix_relative() and install_base_relative() should have the - # same interface). - return File::Spec->abs2rel($path, $rprefix); + $self->log_verbose(" now $path in $rprefix\n"); + + return $path; } |
|
From: Ken W. <kwi...@us...> - 2005-06-25 20:40:38
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10193/lib/Module/Build Modified Files: Base.pm Log Message: Can fairly easily eliminate the _prefixify_default() method when using relative paths Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.446 retrieving revision 1.447 diff -u -d -r1.446 -r1.447 --- Base.pm 25 Jun 2005 20:31:27 -0000 1.446 +++ Base.pm 25 Jun 2005 20:40:30 -0000 1.447 @@ -2684,8 +2684,14 @@ } elsif( $sprefix eq $rprefix ) { $self->log_verbose(" no new prefix.\n"); } elsif( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s ) { - $self->log_verbose(" cannot prefixify.\n"); - $path = $self->_prefixify_default($rprefix, $type); + $self->log_verbose(" cannot prefixify, falling back to default.\n"); + my $default = $self->prefix_relpaths($self->installdirs, $type); + if( !$default ) { + $self->log_verbose(" no default install location for type '$type', using prefix '$rprefix'.\n"); + return $rprefix; + } + + return $default; } $self->log_verbose(" now $path\n"); @@ -2698,28 +2704,6 @@ } -sub _prefixify_default { - my($self, $rprefix, $type) = @_; - $self->log_verbose(" cannot prefix, trying default.\n"); - - my $default = $self->prefix_relpaths($self->installdirs, $type); - - if( !$default ) { - $self->log_verbose(" no default! Using prefix '$rprefix'.\n"); - return $rprefix; - } - if( !$rprefix ) { - $self->log_verbose(" no replacement prefix!\n"); - return; - } - - $self->log_verbose(" using default '$default'.\n"); - - File::Spec->catdir($rprefix, $default), -} - - - sub install_destination { my ($self, $type) = @_; my $p = $self->{properties}; |
|
From: Ken W. <kwi...@us...> - 2005-06-25 20:31:36
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6151/lib/Module/Build Modified Files: Base.pm Log Message: Fix tyop Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.445 retrieving revision 1.446 diff -u -d -r1.445 -r1.446 --- Base.pm 25 Jun 2005 20:29:18 -0000 1.445 +++ Base.pm 25 Jun 2005 20:31:27 -0000 1.446 @@ -2702,7 +2702,7 @@ my($self, $rprefix, $type) = @_; $self->log_verbose(" cannot prefix, trying default.\n"); - my $default = $self->prefix_relpaths($self->installdirs, $type), + my $default = $self->prefix_relpaths($self->installdirs, $type); if( !$default ) { $self->log_verbose(" no default! Using prefix '$rprefix'.\n"); |
|
From: Ken W. <kwi...@us...> - 2005-06-25 20:29:26
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5037/lib/Module/Build Modified Files: Base.pm Log Message: Don't compute the default path relative to the prefix until we need to do so Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.444 retrieving revision 1.445 diff -u -d -r1.444 -r1.445 --- Base.pm 23 Jun 2005 04:35:46 -0000 1.444 +++ Base.pm 25 Jun 2005 20:29:18 -0000 1.445 @@ -2650,7 +2650,7 @@ return $self->_prefixify($normal_location, $self->original_prefix->{$installdirs}, $self->prefix, - $self->prefix_relpaths($installdirs, $type), + $type, ); } @@ -2671,7 +2671,7 @@ # Translated from ExtUtils::MM_Unix::prefixify() sub _prefixify { - my($self, $path, $sprefix, $rprefix, $default) = @_; + my($self, $path, $sprefix, $rprefix, $type) = @_; $rprefix .= '/' if $sprefix =~ m|/$|; @@ -2685,7 +2685,7 @@ $self->log_verbose(" no new prefix.\n"); } elsif( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s ) { $self->log_verbose(" cannot prefixify.\n"); - $path = $self->_prefixify_default($rprefix, $default); + $path = $self->_prefixify_default($rprefix, $type); } $self->log_verbose(" now $path\n"); @@ -2699,10 +2699,11 @@ sub _prefixify_default { - my($self, $rprefix, $default) = @_; - + my($self, $rprefix, $type) = @_; $self->log_verbose(" cannot prefix, trying default.\n"); + my $default = $self->prefix_relpaths($self->installdirs, $type), + if( !$default ) { $self->log_verbose(" no default! Using prefix '$rprefix'.\n"); return $rprefix; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 10:59:50
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25985 Modified Files: MANIFEST Log Message: Remove the "t/XSTest" dist because we now use DistGen to generate test distributions on the fly. Index: MANIFEST =================================================================== RCS file: /cvsroot/module-build/Module-Build/MANIFEST,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- MANIFEST 23 Jun 2005 01:52:12 -0000 1.44 +++ MANIFEST 23 Jun 2005 10:59:09 -0000 1.45 @@ -64,10 +64,3 @@ t/tilde.t t/versions.t t/xs.t -t/XSTest/Build.PL -t/XSTest/Changes -t/XSTest/empty.h -t/XSTest/lib/XSTest.pm -t/XSTest/lib/XSTest.xs -t/XSTest/MANIFEST -t/XSTest/test.pl |
|
From: Randy W. S. <si...@us...> - 2005-06-23 10:59:36
|
Update of /cvsroot/module-build/Module-Build/t/XSTest/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25985/t/XSTest/lib Removed Files: XSTest.pm XSTest.xs Log Message: Remove the "t/XSTest" dist because we now use DistGen to generate test distributions on the fly. --- XSTest.pm DELETED --- --- XSTest.xs DELETED --- |
|
From: Randy W. S. <si...@us...> - 2005-06-23 10:59:36
|
Update of /cvsroot/module-build/Module-Build/t/XSTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25985/t/XSTest Removed Files: Build.PL Changes MANIFEST empty.h test.pl Log Message: Remove the "t/XSTest" dist because we now use DistGen to generate test distributions on the fly. --- test.pl DELETED --- --- empty.h DELETED --- --- Changes DELETED --- --- Build.PL DELETED --- --- MANIFEST DELETED --- |
|
From: Randy W. S. <si...@us...> - 2005-06-23 10:50:51
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21392/t Modified Files: xs.t Log Message: Use the DistGen module for tests. Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- xs.t 23 Jun 2005 10:22:21 -0000 1.20 +++ xs.t 23 Jun 2005 10:50:43 -0000 1.21 @@ -11,12 +11,6 @@ require $common_pl; -use Cwd (); -my $cwd = Cwd::cwd; - - -######################### - use Module::Build; { local $SIG{__WARN__} = sub {}; @@ -39,11 +33,16 @@ ######################### -# Pretend we're in the t/XSTest/ subdirectory -my $build_dir = File::Spec->catdir('t','XSTest'); -chdir $build_dir or die "Can't change to $build_dir : $!"; +use Cwd (); +my $cwd = Cwd::cwd; + +use DistGen; +my $dist = DistGen->new( xs_module => 1 ); +$dist->regen; + +chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; +my $m = Module::Build->new_from_context( skip_rcfile => 1 ); -my $m = Module::Build->new_from_context('skip_rcfile' => '1'); eval {$m->dispatch('clean')}; ok not $@; @@ -58,7 +57,7 @@ $m->create_build_script; ok -e 'Build'; - + eval {$m->run_perl_script('Build')}; ok not $@; } @@ -71,7 +70,8 @@ { $m->dispatch('ppd', args => {codebase => '/path/to/codebase-xs'}); - my $ppd = slurp('XSTest.ppd'); + (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); @@ -80,8 +80,8 @@ # do a strict string comparison, but absent an XML parser it's the # best we can do. is $ppd, <<"EOF"; -<SOFTPKG NAME="XSTest" VERSION="0,01,0,0"> - <TITLE>XSTest</TITLE> +<SOFTPKG NAME="$dist_filename" VERSION="0,01,0,0"> + <TITLE>@{[$dist->name]}</TITLE> <ABSTRACT>Perl extension for blah blah blah</ABSTRACT> <AUTHOR>A. U. Thor, a.u.thor\@a.galaxy.far.far.away</AUTHOR> <IMPLEMENTATION> @@ -111,3 +111,10 @@ # Make sure blib/ is gone after 'realclean' ok not -e 'blib'; + + +######################### +# cleanup + +chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; +$dist->remove; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 10:39:53
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15481/t/lib Modified Files: DistGen.pm Log Message: Add requisite pod documentation to generated modules. Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- DistGen.pm 23 Jun 2005 07:31:27 -0000 1.4 +++ DistGen.pm 23 Jun 2005 10:39:45 -0000 1.5 @@ -70,7 +70,15 @@ =head1 NAME -$self->{name} +$self->{name} - Perl extension for blah blah blah + +=head1 DESCRIPTION + +Stub documentation for $self->{name}. + +=head1 AUTHOR + +A. U. Thor, a.u.thor\@a.galaxy.far.far.away =cut --- @@ -95,6 +103,22 @@ bootstrap $self->{name} \$VERSION; 1; + +__END__ + +=head1 NAME + +$self->{name} - Perl extension for blah blah blah + +=head1 DESCRIPTION + +Stub documentation for $self->{name}. + +=head1 AUTHOR + +A. U. Thor, a.u.thor\@a.galaxy.far.far.away + +=cut --- my $xs_filename = |
|
From: Randy W. S. <si...@us...> - 2005-06-23 10:22:32
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6645/t Modified Files: xs.t Log Message: use Test::More Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- xs.t 7 Apr 2005 01:51:40 -0000 1.19 +++ xs.t 23 Jun 2005 10:22:21 -0000 1.20 @@ -1,14 +1,24 @@ -######################### We start with some black magic to print on failure. +#!/usr/bin/perl -w +use lib 't/lib'; use strict; -use Test; -use Config; -use Module::Build; -use File::Spec; -my $common_pl = File::Spec->catfile('t', 'common.pl'); +use Test::More; + + +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); require $common_pl; + +use Cwd (); +my $cwd = Cwd::cwd; + + +######################### + +use Module::Build; + { local $SIG{__WARN__} = sub {}; my $m = Module::Build->current; @@ -18,47 +28,45 @@ stderr_of( sub {$have_c_compiler = $m->have_c_compiler} ); if ( ! $m->feature('C_support') ) { - print("1..0 # Skipped: C_support not enabled\n"); - exit(0); + plan skip_all => 'C_support not enabled'; } elsif ( !$have_c_compiler ) { - print("1..0 # Skipped: C_support enabled, but no compiler found\n"); - exit(0); + plan skip_all => 'C_support enabled, but no compiler found'; + } else { + plan tests => 11; } } -######################### End of black magic. +######################### -plan tests => 12; # Pretend we're in the t/XSTest/ subdirectory my $build_dir = File::Spec->catdir('t','XSTest'); chdir $build_dir or die "Can't change to $build_dir : $!"; my $m = Module::Build->new_from_context('skip_rcfile' => '1'); -ok(1); eval {$m->dispatch('clean')}; -ok $@, ''; +ok not $@; eval {$m->dispatch('build')}; -ok $@, ''; +ok not $@; { # Try again in a subprocess eval {$m->dispatch('clean')}; - ok $@, ''; + ok not $@; $m->create_build_script; ok -e 'Build'; eval {$m->run_perl_script('Build')}; - ok $@, ''; + ok not $@; } # 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')}; -ok $@, ''; +ok not $@; { $m->dispatch('ppd', args => {codebase => '/path/to/codebase-xs'}); @@ -71,7 +79,7 @@ # 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 # best we can do. - ok $ppd, <<"EOF"; + is $ppd, <<"EOF"; <SOFTPKG NAME="XSTest" VERSION="0,01,0,0"> <TITLE>XSTest</TITLE> <ABSTRACT>Perl extension for blah blah blah</ABSTRACT> @@ -86,20 +94,20 @@ EOF } -if ($m->os_type eq 'Unix') { +SKIP: { + skip( "skipping a couple Unixish-only tests", 2 ) + unless $m->os_type eq 'Unix'; + eval {$m->dispatch('clean')}; - ok $@, ''; - + ok not $@; + local $m->{config}{ld} = "FOO=BAR $m->{config}{ld}"; eval {$m->dispatch('build')}; - ok $@, ''; -} else { - skip_subtest("skipping a couple Unixish-only tests") for 1..2; + ok not $@; } eval {$m->dispatch('realclean')}; -ok $@, ''; +ok not $@; # Make sure blib/ is gone after 'realclean' ok not -e 'blib'; - |
|
From: Randy W. S. <si...@us...> - 2005-06-23 08:45:13
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20175/t Modified Files: files.t notes.t tilde.t Log Message: Rearrange init code for consistency. Index: files.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/files.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- files.t 23 Jun 2005 07:55:52 -0000 1.4 +++ files.t 23 Jun 2005 08:44:47 -0000 1.5 @@ -1,11 +1,9 @@ +#!/usr/bin/perl -w + use lib 't/lib'; use strict; -use Test::More tests => 6; - - -use File::Spec; -use IO::File; +use Test::More tests => 5; use Cwd (); @@ -18,9 +16,11 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -use Module::Build; -ok(1); +use File::Spec; +use IO::File; + +use Module::Build; my $m = Module::Build->new_from_context; my @files; Index: notes.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/notes.t,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- notes.t 23 Jun 2005 08:20:22 -0000 1.10 +++ notes.t 23 Jun 2005 08:44:47 -0000 1.11 @@ -1,7 +1,10 @@ +#!/usr/bin/perl -w + use lib 't/lib'; use strict; -use Test::More tests => 9; +use Test::More tests => 8; + use Cwd (); my $cwd = Cwd::cwd; @@ -12,8 +15,8 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; + use Module::Build; -ok(1); ################################### $dist->change_file( 'Build.PL', <<"---" ); Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- tilde.t 23 Jun 2005 07:30:17 -0000 1.7 +++ tilde.t 23 Jun 2005 08:44:48 -0000 1.8 @@ -5,13 +5,13 @@ use lib 't/lib'; use strict; +use Test::More tests => 10; + + use File::Spec (); my $common_pl = File::Spec->catfile( 't', 'common.pl' ); require $common_pl; -use Test::More tests => 10; - -use Module::Build; use Cwd (); my $cwd = Cwd::cwd; @@ -22,6 +22,9 @@ chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; + +use Module::Build; + sub run_sample { my @args = @_; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 08:32:41
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13862/t Modified Files: destinations.t Log Message: Use the DistGen module for tests. Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- destinations.t 23 Jun 2005 02:49:44 -0000 1.18 +++ destinations.t 23 Jun 2005 08:32:33 -0000 1.19 @@ -1,24 +1,32 @@ #!/usr/bin/perl -w +use lib 't/lib'; use strict; -use Config; -use File::Spec::Functions qw( catdir splitdir ); +use Test::More tests => 66; -use File::Spec; -BEGIN { - my $common_pl = File::Spec->catfile('t', 'common.pl'); - require $common_pl; -} +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); +require $common_pl; -use Test::More tests => 67; +use Cwd (); +my $cwd = Cwd::cwd; -use_ok 'Module::Build'; +use DistGen; +my $dist = DistGen->new; +$dist->regen; + +chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -my $M = Module::Build->current; +use Config; +use File::Spec::Functions qw( catdir splitdir ); + + +use Module::Build; +my $M = Module::Build->new_from_context; isa_ok( $M, 'Module::Build::Base' ); my $Install_Sets = $M->install_sets; @@ -193,3 +201,7 @@ is( $mb->install_destination($type), $expect, "$type destination" ); } } + + +chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; +$dist->remove; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 08:20:33
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7511/t Modified Files: notes.t Log Message: Use the DistGen module for tests. Index: notes.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/notes.t,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- notes.t 23 Jun 2005 07:58:08 -0000 1.9 +++ notes.t 23 Jun 2005 08:20:22 -0000 1.10 @@ -3,13 +3,33 @@ use Test::More tests => 9; +use Cwd (); +my $cwd = Cwd::cwd; + +use DistGen; +my $dist = DistGen->new; +$dist->regen; + +chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; + use Module::Build; ok(1); ################################### -my $m = Module::Build->current; +$dist->change_file( 'Build.PL', <<"---" ); +use Module::Build; +my \$build = Module::Build->new( + module_name => @{[$dist->name]}, + license => 'perl' +); +\$build->create_build_script; +\$build->notes(foo => 'bar'); +--- + +$dist->regen; + +my $m = Module::Build->new_from_context; -# This was set in Build.PL is $m->notes('foo'), 'bar'; # Try setting & checking a new value @@ -26,9 +46,7 @@ ################################### # Make sure notes set before create_build_script() get preserved -my $testdir = Module::Build->localize_file_path('t/Sample'); -chdir $testdir or die "Can't chdir($testdir): $!"; -$m = Module::Build->new(module_name => 'Sample'); +$m = Module::Build->new(module_name => $dist->name); ok $m; $m->notes(foo => 'bar'); is $m->notes('foo'), 'bar'; @@ -38,3 +56,7 @@ $m = Module::Build->resume; ok $m; is $m->notes('foo'), 'bar'; + + +chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; +$dist->remove; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 08:20:33
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7511 Modified Files: Build.PL Log Message: Use the DistGen module for tests. Index: Build.PL =================================================================== RCS file: /cvsroot/module-build/Module-Build/Build.PL,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- Build.PL 7 Jun 2005 21:40:11 -0000 1.54 +++ Build.PL 23 Jun 2005 08:20:22 -0000 1.55 @@ -76,4 +76,3 @@ ); $build->create_build_script; -$build->notes(foo => 'bar'); # We set this here and verify it in t/notes.t |