74
74
}
75
75
76
76
sub build_app {
77
- my ($bits , $notest ) = @_ ;
77
+ my ($arch , $notest ) = @_ ;
78
78
79
79
my $package_rev = $ENV {PACKAGE_REVISION } || PACKAGE_REVISION;
80
80
@@ -93,8 +93,8 @@ sub build_app {
93
93
agent_regpath => " Software\\ $provider -Agent" ,
94
94
service_name => lc ($provider ).' -agent' ,
95
95
msi_sharedir => ' contrib/windows/packaging' ,
96
- arch => $bits == 32 ? " x86 " : " x64 " ,
97
- _dllsuffix => $bits == 32 ? ' _' : ' __' ,
96
+ arch => $arch ,
97
+ _dllsuffix => $arch eq " x86 " ? ' _' : ' __' ,
98
98
_restore_step => PERL_BUILD_STEPS,
99
99
);
100
100
@@ -126,9 +126,15 @@ sub build_app {
126
126
}
127
127
}
128
128
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 );
132
138
$app -> do_job();
133
139
# global_dump_FINAL.txt must exist in debug_dir if all steps have been passed
134
140
exit (1) unless -e catfile($app -> global-> {debug_dir }, ' global_dump_FINAL.txt' );
@@ -221,10 +227,22 @@ sub run {
221
227
$self -> boss-> message(2, " Test: gonna run perl Makefile.PL" );
222
228
my $rv = $self -> execute_standard($makefile_pl_cmd );
223
229
die " ERROR: TEST, perl Makefile.PL\n " unless (defined $rv && $rv == 0);
230
+ }
224
231
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 }}) {
228
246
my %skip_tests = map { $_ => 1 } @{$self -> {config }-> {skip_tests }};
229
247
@test_files = grep { not $skip_tests {$_ } } @test_files ;
230
248
}
@@ -233,12 +251,10 @@ sub run {
233
251
my $make_test_cmd = [ $makebin , " test" ];
234
252
push @{$make_test_cmd }, " TEST_FILES=@test_files " if @test_files ;
235
253
$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 );
237
255
die " ERROR: TEST, make test\n " unless (defined $rv && $rv == 0);
238
256
}
239
257
240
- sub test {}
241
-
242
258
package
243
259
Perl::Dist::GLPI::Agent::Step::InstallModules;
244
260
0 commit comments