Skip to content
Browse files

just need to run Build test as an external cmd if we use SDLPerl as i…

…nterpreter
  • Loading branch information...
1 parent 57c5667 commit 3d651d3b46fc4fde9a013968cb73ab670f60ce58 @FROGGS FROGGS committed with garu Jun 13, 2011
Showing with 17 additions and 10 deletions.
  1. +17 −10 inc/My/Builder/Darwin.pm
View
27 inc/My/Builder/Darwin.pm
@@ -48,23 +48,30 @@ sub build_bundle {
my $cmd =
"gcc $arch -o \"blib/script/SDLPerl\" MacOSX/main.c $cflags $libs";
$cmd =~ s/\s+/ /g;
- print STDERR $cmd . "\n";
- system($cmd);
+ unless(-e 'blib/script/SDLPerl') {
+ print STDERR $cmd . "\n";
+ system($cmd);
+ }
}
sub ACTION_test {
my $self = shift;
+ $self->depends_on('build');
$self->build_bundle() if !( -e 'blib/script/SDLPerl' );
- my $cmd = ($ENV{SDL_RELEASE_TESTING} ? 'blib/script/SDLPerl' : $^X)
- . ' ' . getcwd() . '/Build test';
- if ( $ENV{SDL_PERL_TEST} ) {
- $self->Module::Build::ACTION_test;
- $ENV{SDL_PERL_TEST} = 0; #unset it again
+ if( $ENV{SDL_RELEASE_TESTING} ) {
+ if ( $ENV{SDL_PERL_TEST} ) {
+ $self->Module::Build::ACTION_test;
+ $ENV{SDL_PERL_TEST} = 0; #unset it again
+ }
+ else {
+ my $cmd = 'blib/script/SDLPerl Build test';
+ $ENV{SDL_PERL_TEST} = 1;
+ system( split ' ', $cmd );
+ die 'Errors in Testing. Can\'t continue' if $?;
+ }
}
else {
- $ENV{SDL_PERL_TEST} = 1;
- system( split ' ', $cmd );
- die 'Errors in Testing. Can\'t continue' if $?;
+ $self->Module::Build::ACTION_test;
}
}

0 comments on commit 3d651d3

Please sign in to comment.
Something went wrong with that request. Please try again.