Skip to content

Commit b5d86a1

Browse files
committed
Separates files in batches. Should help with #1951
1 parent e8d5cf7 commit b5d86a1

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

t/02-pod-valid.t

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,37 @@ Ensure any text that isn't a code example has valid POD6
1515

1616
my $max-jobs = %*ENV<TEST_THREADS> // 2;
1717

18-
my @files = Test-Files.files.grep({$_.ends-with: '.pod6'|'.t'});
19-
20-
plan +@files;
18+
my @files-pod = Test-Files.files.grep({$_.ends-with: '.pod6'});
19+
my @files-t = Test-Files.files.grep({$_.ends-with: '.t'});
20+
plan +@files-t + +@files-pod;
2121

2222
my %data;
23+
test-files( @files-pod );
24+
test-files( @files-t );
2325

2426
sub test-it($job) {
2527
my $file = $job.command[*-1];
2628
ok !$job.exitcode && !%data{$file}, "$file has clean POD6"
2729
}
2830

29-
my @jobs;
30-
%data{@files} = 0 xx @files;
31-
for @files -> $file {
32-
my $p = Proc::Async.new($*EXECUTABLE-NAME, '--doc', $file);
33-
$p.stdout.tap: {;};
34-
$p.stderr.tap: {
35-
%*ENV<P6_DOC_TEST_VERBOSE> and diag "$file STDERR: $_";
36-
%data{$file} = 1;
37-
}
38-
push @jobs: $p.start;
39-
if +@jobs > $max-jobs {
40-
test-it(await @jobs.shift);
31+
sub test-files( @files ) {
32+
my @jobs;
33+
%data{@files} = 0 xx @files;
34+
for @files -> $file {
35+
my $p = Proc::Async.new($*EXECUTABLE-NAME, '--doc', $file);
36+
$p.stdout.tap: {;};
37+
$p.stderr.tap: {
38+
%*ENV<P6_DOC_TEST_VERBOSE> and diag "$file STDERR: $_";
39+
%data{$file} = 1;
40+
}
41+
push @jobs: $p.start;
42+
if +@jobs > $max-jobs {
43+
test-it(await @jobs.shift);
44+
}
4145
}
46+
47+
for @jobs.map: {await $_} -> $r { test-it($r) }
4248
}
4349

44-
for @jobs.map: {await $_} -> $r { test-it($r) }
4550

4651
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)