X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cpan-stable-smolder;h=18daa3296ed89887dd5c7fbbdda593782bf9d163;hb=bf6996ff2a1bd65a412d13cdd477a0e52b4642cb;hp=9ef4fd548a2d198028880dafd83622d9643c3f88;hpb=aa815f88979ebe9d1c57ef38f83a2ed16e5296cd;p=gitmo%2Fmoose-dev-utils.git diff --git a/cpan-stable-smolder b/cpan-stable-smolder index 9ef4fd5..18daa32 100755 --- a/cpan-stable-smolder +++ b/cpan-stable-smolder @@ -105,7 +105,9 @@ test_all_modules( MooseX::WithCache MooseX::Workers MooseX::YAML - Fey-ORM + Fey::ORM + KiokuDB + Catalyst ] ); @@ -113,6 +115,24 @@ close $log; exit; +sub test_all_modules { + foreach my $project (@_) { + my $dist = get_distro_from_cpan($project); + + unless ($dist) { + print $log "UNKNOWN : $project (not on CPAN?)\n"; + next; + } + + my $passed = test_module( $dist->dir() ); + + my $msg = $passed ? 'SUCCESS' : 'FAIL'; + + print $log sprintf( '%7s : %s - %s', $msg, $project, $dist->base_id() ); + print $log "\n"; + } +} + sub get_distro_from_cpan { my $project = shift; @@ -138,30 +158,31 @@ sub test_module { local $CWD = $dir; local $ENV{PERL_AUTOINSTALL} = '--defaultdeps'; - if ( -f "Makefile.PL" ) { - return ! system $^X . ' Makefile.PL && make && make test'; + if ( -f "Build.PL" ) { + _run_commands( + [ $^X, 'Build.PL' ], + ['./Build'], + [qw( ./Build test )], + ); } else { - return ! system $^X . ' Build.PL && ./Build && ./Build test'; + _run_commands( + [ $^X, 'Makefile.PL' ], + ['make'], + [qw( make test )], + ); } } -sub test_all_modules { - foreach my $project (@_) { - my $dist = get_distro_from_cpan($project); - - unless ($dist) { - print $log "UNKNOWN : $project (not on CPAN?)\n"; - next; +sub _run_commands { + for my $cmd (@_) { + if ( system( @{$cmd} ) ) { + warn "Failed to run @{$cmd}\n"; + return; } - - my $passed = test_module( $dist->dir() ); - - my $msg = $passed ? 'SUCCESS' : 'FAIL'; - - print $log sprintf( '%7s : %s - %s', $msg, $project, $dist->base_id() ); - print $log "\n"; } + + return 1; } 1;