diff options
-rw-r--r-- | lib/CPANPLUS/Dist/Build.pm | 11 | ||||
-rw-r--r-- | lib/CPANPLUS/Dist/Build/t/01_CPANPLUS-Dist-Build-Constants.t | 8 | ||||
-rw-r--r-- | lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t | 10 | ||||
-rw-r--r-- | lib/CPANPLUS/Dist/Build/t/inc/conf.pl | 49 | ||||
-rw-r--r-- | lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz.packed | 2 | ||||
-rw-r--r-- | lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz.packed | 2 |
6 files changed, 74 insertions, 8 deletions
diff --git a/lib/CPANPLUS/Dist/Build.pm b/lib/CPANPLUS/Dist/Build.pm index 4d4aec03a1..bd08e39f15 100644 --- a/lib/CPANPLUS/Dist/Build.pm +++ b/lib/CPANPLUS/Dist/Build.pm @@ -29,7 +29,7 @@ use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; local $Params::Check::VERBOSE = 1; -$VERSION = '0.06'; +$VERSION = '0.06_01'; =pod @@ -535,10 +535,13 @@ sub create { ### send success on force... $test_fail++; - unless($force) { - $dist->status->test(0); - $fail++; last RUN; + if( !$force and !$cb->_callbacks->proceed_on_test_failure->( + $self, $@ ) + ) { + $dist->status->test(0); + $fail++; last RUN; } + } else { $dist->status->test(1); } diff --git a/lib/CPANPLUS/Dist/Build/t/01_CPANPLUS-Dist-Build-Constants.t b/lib/CPANPLUS/Dist/Build/t/01_CPANPLUS-Dist-Build-Constants.t index c7cb348a3e..a1be08473d 100644 --- a/lib/CPANPLUS/Dist/Build/t/01_CPANPLUS-Dist-Build-Constants.t +++ b/lib/CPANPLUS/Dist/Build/t/01_CPANPLUS-Dist-Build-Constants.t @@ -1,3 +1,11 @@ +### make sure we can find our conf.pl file +BEGIN { + use FindBin; + require "$FindBin::Bin/inc/conf.pl"; +} + + + BEGIN { chdir 't' if -d 't' }; ### this is to make devel::cover happy ### diff --git a/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t b/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t index 9417cece55..92da2566a0 100644 --- a/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t +++ b/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t @@ -194,7 +194,12 @@ while( my($path,$need_cc) = each %Map ) { ### since we're die'ing in the Build.PL, do a local *STDERR, ### so we dont spam the result through the test -- this is expected ### behaviour after all. - my $rv = do { local *STDERR; $clone->prepare( force => 1 ) }; + ### also quell the warning for print() on unopened fh... + my $rv = do { + local $^W; + local *STDERR; + $clone->prepare( force => 1 ) + }; ok( !$rv, ' $mod->prepare failed' ); my $re = quotemeta( $build_pl ); @@ -209,7 +214,8 @@ while( my($path,$need_cc) = each %Map ) { sub find_module { my $module = shift; - # Don't add the .pm yet, in case it's a packlist or something like ExtUtils::xsubpp. + ### Don't add the .pm yet, in case it's a packlist or something + ### like ExtUtils::xsubpp. my $file = File::Spec->catfile( split m/::/, $module ); my $candidate; foreach (@INC) { diff --git a/lib/CPANPLUS/Dist/Build/t/inc/conf.pl b/lib/CPANPLUS/Dist/Build/t/inc/conf.pl index 1892922f1d..ff77c61266 100644 --- a/lib/CPANPLUS/Dist/Build/t/inc/conf.pl +++ b/lib/CPANPLUS/Dist/Build/t/inc/conf.pl @@ -62,6 +62,55 @@ use File::Basename qw[basename]; $Locale::Maketext::Lexicon::VERSION = 0; } +### clean up files for PERLCORE mostly -- make clean isn't invoked +### there... otoh, we should clean up after ourselves anyway. +END { + ### chdir to our own test dir, so we know all files are relative + ### to this point, no matter whether run from perlcore tests or + ### regular CPAN installs + chdir "$FindBin::Bin" if -d "$FindBin::Bin"; + + ### XXX hardcoded + _clean_test_dir( [qw|dummy-perl dummy-cpanplus| ] ); +} + +### whenever we start a new script, we want to clean out our +### old files from the test '.cpanplus' dir.. +sub _clean_test_dir { + my $dirs = shift || []; + my $verbose = shift || 0; + + for my $dir ( @$dirs ) { + + ### if it's not there, don't bother + next unless -d $dir; + + my $dh; + opendir $dh, $dir or die "Could not open basedir '$dir': $!"; + while( my $file = readdir $dh ) { + next if $file =~ /^\./; # skip dot files + + my $path = File::Spec->catfile( $dir, $file ); + + ### directory, rmtree it + if( -d $path ) { + print "Deleting directory '$path'\n" if $verbose; + eval { rmtree( $path ) }; + warn "Could not delete '$path' while cleaning up '$dir'" if $@; + + ### regular file + } else { + print "Deleting file '$path'\n" if $verbose; + 1 while unlink $path; + } + } + + close $dh; + } + + return 1; +} + 1; __END__ diff --git a/lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz.packed b/lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz.packed index e978261b98..cc2951c868 100644 --- a/lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz.packed +++ b/lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz.packed -Created at Fri May 4 14:00:53 2007 +Created at Tue May 22 13:44:00 2007 ######################################################################### __UU__ M'XL("-<X34(``T9O;RU"87(M,"XP,2YT87(`[9E;;]HP%,=Y]J<X+9722@-R diff --git a/lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz.packed b/lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz.packed index 52e09e2a17..bdb76d27d2 100644 --- a/lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz.packed +++ b/lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz.packed -Created at Fri May 4 14:00:54 2007 +Created at Tue May 22 13:44:00 2007 ######################################################################### __UU__ M'XL("-\X34(``T9O;RU"87(M,"XP,2YT87(`[5K_3QI)%/=7YZ]XU39H(BN[ |