-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
status_upd
executable file
·81 lines (70 loc) · 1.88 KB
/
status_upd
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/perl -w
# status_upd.pl [1.04_26]
# process perlall-maketest logfiles: `perl$ver Makefile.PL && make test > log.test-$platform-$ver; make clean`
use strict;
my $logs = "log.test-*-5.*";
my $dir = ".";
my $STATUS = "./STATUS";
chdir ".." if ! -d "t" and -d "../t";
chdir "../.." if ! -d "t" and -d "../../t";
if (@ARGV and -d "t/reports/$ARGV[0]") {
$dir = "t/reports/".$ARGV[0];
}
if (@ARGV and -d $ARGV[0]) {
$dir = $ARGV[0];
}
die "$STATUS not found\n" unless -f $STATUS;
sub status {
my @g = @_;
my $s = "";
my $prefix = '';
my $oldprefix = '';
while (@g) {
if ($g[0] =~ /^--/) {
$oldprefix = $prefix if $prefix;
$prefix = '';
shift @g;
next;
}
my $file = shift @g;
my $failed = shift @g;
unless ($prefix) {
($prefix) = $file =~ m{log.test-(.*?)-t/};
if ($prefix and $oldprefix ne $prefix) {
$prefix = 'cygwin' if $prefix eq 'ATGRZWN502840';
$s .= "\n$prefix:\n";
print STDERR "\n$prefix:\n";
}
}
next unless $prefix;
($file) = $file =~ m{log.test-.*-(t/[\w\.]+\s?)};
chomp $file if $file;
next unless $file;
$failed =~ s{^.+(Failed tests?:?)}{$1}i;
$failed =~ s{^.+TODO passed:}{TODO passed:};
chomp $failed;
my $c = "$file\t";
$c .= "\t" if length($file) < 8;
$c .= "$failed\n";
print STDERR "$c";
$s .= $c;
}
}
# update the TEST STATUS section in "./STATUS"
# TODO grep -a -B1 -i "TODO passed" ' . ($dir eq '.' ? "$logs" : "$dir/$logs"
my $cmd = 'grep -a -B1 -i "Failed test" ' . ($dir eq '.' ? "$logs" : "$dir/$logs");
print STDERR "$cmd\n";
my @g = `$cmd` or die $@;
status(@g);
$cmd = 'grep -a -B1 -i "TODO passed" ' . ($dir eq '.' ? "$logs" : "$dir/$logs");
print STDERR "\n$cmd\n";
@g = `$cmd` or die $@;
status(@g);
#print $s;
exit;
# Local Variables:
# mode: cperl
# cperl-indent-level: 2
# fill-column: 100
# End:
# vim: expandtab shiftwidth=2: