7474}
7575
7676sub build_app {
77- my ($bits , $notest ) = @_ ;
77+ my ($arch , $notest ) = @_ ;
7878
7979 my $package_rev = $ENV {PACKAGE_REVISION } || PACKAGE_REVISION;
8080
@@ -93,8 +93,8 @@ sub build_app {
9393 agent_regpath => " Software\\ $provider -Agent" ,
9494 service_name => lc ($provider ).' -agent' ,
9595 msi_sharedir => ' contrib/windows/packaging' ,
96- arch => $bits == 32 ? " x86 " : " x64 " ,
97- _dllsuffix => $bits == 32 ? ' _' : ' __' ,
96+ arch => $arch ,
97+ _dllsuffix => $arch eq " x86 " ? ' _' : ' __' ,
9898 _restore_step => PERL_BUILD_STEPS,
9999 );
100100
@@ -126,9 +126,15 @@ sub build_app {
126126 }
127127}
128128
129- foreach my $bits (sort values (%do )) {
130- print " Building $bits bits packages...\n " ;
131- my $app = build_app($bits , $notest );
129+ # Still select a defaut arch if none has been selected
130+ $do {x64 } = 64 unless keys (%do );
131+
132+ die " 32 bits packaging build no more supported\n "
133+ if $do {x86 };
134+
135+ foreach my $arch (sort keys (%do )) {
136+ print " Building $arch packages...\n " ;
137+ my $app = build_app($arch , $notest );
132138 $app -> do_job();
133139 # global_dump_FINAL.txt must exist in debug_dir if all steps have been passed
134140 exit (1) unless -e catfile($app -> global-> {debug_dir }, ' global_dump_FINAL.txt' );
@@ -221,10 +227,22 @@ sub run {
221227 $self -> boss-> message(2, " Test: gonna run perl Makefile.PL" );
222228 my $rv = $self -> execute_standard($makefile_pl_cmd );
223229 die " ERROR: TEST, perl Makefile.PL\n " unless (defined $rv && $rv == 0);
230+ }
224231
225- my @test_files = ref ($self -> {config }-> {test_files }) ?
226- map { bsd_glob($_ ) } @{$self -> {config }-> {test_files }} : qw( t/01compile.t) ;
227- if (ref ($self -> {config }-> {skip_tests }) && @{$self -> {config }-> {skip_tests }}) {
232+ sub test {
233+ my $self = shift ;
234+
235+ # Update PATH to include perl/bin for DLLs loading
236+ my $binpath = catfile($self -> global-> {image_dir }, ' perl/bin' );
237+ $ENV {PATH } .= " :$binpath " ;
238+
239+ # Without defined modules, run the tests
240+ my $makebin = catfile($binpath , ' gmake.exe' );
241+
242+ my @test_files = qw( t/01compile.t) ;
243+ @test_files = map { bsd_glob($_ ) } @{$self -> {config }-> {test_files }}
244+ if ref ($self -> {config }-> {test_files }) && @{$self -> {config }-> {test_files }};
245+ if (@test_files && ref ($self -> {config }-> {skip_tests }) && @{$self -> {config }-> {skip_tests }}) {
228246 my %skip_tests = map { $_ => 1 } @{$self -> {config }-> {skip_tests }};
229247 @test_files = grep { not $skip_tests {$_ } } @test_files ;
230248 }
@@ -233,12 +251,10 @@ sub run {
233251 my $make_test_cmd = [ $makebin , " test" ];
234252 push @{$make_test_cmd }, " TEST_FILES=@test_files " if @test_files ;
235253 $self -> boss-> message(2, " Test: gonna run gmake test" );
236- $rv = $self -> execute_standard($make_test_cmd );
254+ my $rv = $self -> execute_standard($make_test_cmd );
237255 die " ERROR: TEST, make test\n " unless (defined $rv && $rv == 0);
238256}
239257
240- sub test {}
241-
242258package
243259 Perl::Dist::GLPI::Agent::Step::InstallModules;
244260
0 commit comments