From: Dave Rolsky Date: Mon, 27 Apr 2009 21:20:44 +0000 (-0500) Subject: Add KiokuDB to smoke list. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=81b7b4067ae49c6d6df5bc5f2c544829e9637c87;p=gitmo%2Fmoose-dev-utils.git Add KiokuDB to smoke list. Prefer Build.PL to Makefile.PL Move command running to its own sub. --- diff --git a/cpan-stable-smolder b/cpan-stable-smolder index 9ef4fd5..9da5416 100755 --- a/cpan-stable-smolder +++ b/cpan-stable-smolder @@ -105,7 +105,8 @@ test_all_modules( MooseX::WithCache MooseX::Workers MooseX::YAML - Fey-ORM + Fey::ORM + KiokuDB ] ); @@ -113,6 +114,24 @@ close $log; exit; +sub test_all_modules { + foreach my $project (grep {$_ eq 'Fey::ORM'}@_) { + 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,29 +157,28 @@ 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"; } }