-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-tests-valid.t
executable file
·60 lines (44 loc) · 1.25 KB
/
02-tests-valid.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env raku
use lib $*PROGRAM.parent(2).child('lib');
use Test;
BEGIN plan :skip-all<Test applicable to git checkout only> unless '.git'.IO.e;
use Test-Files;
=begin overview
Ensure any test file, including author tests, have clean syntax and POD
=end overview
my @files = Test-Files.files.grep({$_.ends-with: '.t'});
if @files {
plan +@files;
} else {
plan :skip-all<No test files specified>
}
my %data;
my $lock = Lock.new;
my $verbose = %*ENV<P6_DOC_TEST_VERBOSE> // False;
@files.race.map: -> $file {
react {
my $proc = Proc::Async.new([$*EXECUTABLE-NAME, '-c', $file]);
whenever $proc.stdout.lines {
; #discard
}
whenever $proc.stderr.lines {
# An error occurred
$verbose and diag("$file error: $_");
$lock.protect: {
%data{$file} = False;
};
}
whenever $proc.start {
$lock.protect: {
if %data{$file}:!exists {
%data{$file} = !.exitcode; # 0 = True, anything else False
}
};
done;
}
}
}
for %data.keys.sort -> $file {
ok %data{$file}, "$file Pod6 and syntax check out";
}
# vim: expandtab shiftwidth=4 ft=perl6