Imported Upstream version 1.10.2
[platform/upstream/krb5.git] / src / kadmin / testing / scripts / verify_xrunner_report.plin
1 #!/usr/local/bin/perl
2
3 sub usage { die "usage: $0 reportfile\n"; }
4
5 $report = shift(@ARGV) || die &usage;
6
7 open(REPORT, $report) || die "Couldn't open $report: $!\n";
8
9 while(<REPORT>) {
10     if (/Process termination:/ && !/\bOK\b/) {
11         warn "Process termination not OK\n";
12         $warnings++;
13     } elsif (/Number of detected mismatches:\s*(\d+)/ && ($1 ne "0")) {
14         warn "Number of detected mismatches = $1\n";
15         $warnings++;
16     } elsif (/Detailed Results Description/) {
17         break;
18     }
19 }
20
21 while(<REPORT>) {
22     next if !/^\d+\s+/;
23
24     split;
25
26     if (($_[2] ne "run") &&
27         ($_[2] ne "OK") &&
28         ($_[2] ne "end-of-test")) {
29         warn "Unexpected result code $_[2] from test $_[4]\n";
30         $warnings++;
31     }
32 }
33
34 if ($warnings) {
35     warn "$warnings warnings.\n";
36 }
37
38 exit($warnings);