Skip to content

Commit eb85b37

Browse files
committed
ensure each batch size is 20 max
1 parent c340d62 commit eb85b37

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/test.pl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,11 +564,14 @@ =head1 SYNOPSIS
564564
# Batch files to avoid command-line length issues
565565
my $batchSize = 20;
566566
my $exitStatus = 0;
567-
for (my $i = 0; $i < scalar(@fileList); $i += $batchSize) {
568-
my @batch = @fileList[$i .. ($i + $batchSize - 1 < $#fileList ? $i + $batchSize - 1 : $#fileList)];
567+
my $totalFiles = scalar(@fileList);
568+
for (my $i = 0; $i < $totalFiles; $i += $batchSize) {
569+
my @batch;
570+
for (my $j = $i; $j < $i + $batchSize && $j < $totalFiles; $j++) {
571+
push @batch, $fileList[$j];
572+
}
569573
my $strCommand = $strBaseCommand . ' ' . join(' ', @batch);
570574
my $out = executeTest($strCommand . " 2>&1");
571-
# If any batch fails, set exitStatus to nonzero
572575
$exitStatus ||= ($? >> 8);
573576
}
574577
if ($exitStatus != 0) {

0 commit comments

Comments
 (0)