Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | open(LOG, $ARGV[0]); |
---|
4 | @lines = <LOG>; |
---|
5 | |
---|
6 | foreach $line (@lines) { |
---|
7 | if ($line =~ /^[A-Z]+/) { |
---|
8 | chomp($line); |
---|
9 | ($type, @rest) = split(/:/, $line); |
---|
10 | |
---|
11 | $message = ""; |
---|
12 | foreach $chunk (@rest) { |
---|
13 | $message .= $chunk; |
---|
14 | } |
---|
15 | |
---|
16 | if ($type eq "REASON") { |
---|
17 | |
---|
18 | $last_reason = $message ; |
---|
19 | |
---|
20 | } elsif ($type =~ /X?FAIL/) { |
---|
21 | |
---|
22 | $rest[0] =~ /([^\. ]+)\.test/; |
---|
23 | $name = $1; |
---|
24 | |
---|
25 | $passfail = $type; |
---|
26 | $testname = $name; |
---|
27 | $extra = "\n\t$last_reason\n"; |
---|
28 | |
---|
29 | $last_reason = "Unknown reason"; |
---|
30 | |
---|
31 | } elsif ($type =~ /X?PASS/) { |
---|
32 | |
---|
33 | $rest[0] =~ /([^\. ]+)\.test/; |
---|
34 | $name = $1; |
---|
35 | |
---|
36 | $passfail = $type; |
---|
37 | $testname = $name; |
---|
38 | $extra = ""; |
---|
39 | |
---|
40 | $last_reason = "Unknown reason"; |
---|
41 | |
---|
42 | } else { |
---|
43 | |
---|
44 | $passfail = $type; |
---|
45 | $testname = "UNKN"; |
---|
46 | $extra = "Unknown status type $type!"; |
---|
47 | |
---|
48 | $last_reason = "Unknown reason"; |
---|
49 | |
---|
50 | } |
---|
51 | |
---|
52 | push(@results, ([$testname, $passfail, $extra])); |
---|
53 | |
---|
54 | } |
---|
55 | |
---|
56 | } |
---|
57 | |
---|
58 | foreach $test (@results) { |
---|
59 | |
---|
60 | |
---|
61 | if ($tests{$test->[0]} eq undef) { |
---|
62 | if ($test->[1] =~ /^X?FAIL/) { |
---|
63 | $fmt = "%5s: %s %s\n"; |
---|
64 | printf($fmt, $test->[1], $test->[0], $test->[2]); |
---|
65 | } |
---|
66 | $tests{$test->[0]} = 1; |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | } |
---|
71 | |
---|
Note: See
TracBrowser
for help on using the repository browser.