ia64/xen-unstable

view tools/xm-test/mkreport @ 8186:28bd01c9b596

Merge
author djm@kirby.fc.hp.com
date Fri Dec 02 12:52:25 2005 -0600 (2005-12-02)
parents ecb5997f7b25
children 139aabe357a4
line source
1 #!/usr/bin/perl
3 open(LOG, $ARGV[0]);
4 @lines = <LOG>;
6 foreach $line (@lines) {
7 if ($line =~ /^[A-Z]+/) {
8 chomp($line);
9 ($type, @rest) = split(/:/, $line);
11 $message = "";
12 foreach $chunk (@rest) {
13 $message .= $chunk;
14 }
16 if ($type eq "REASON") {
18 $last_reason = $message ;
20 } elsif ($type =~ /X?FAIL/) {
22 $rest[0] =~ /([^\. ]+)\.test/;
23 $name = $1;
25 $passfail = $type;
26 $testname = $name;
27 $extra = "\n\t$last_reason\n";
29 $last_reason = "Unknown reason";
31 } elsif ($type =~ /X?PASS/) {
33 $rest[0] =~ /([^\. ]+)\.test/;
34 $name = $1;
36 $passfail = $type;
37 $testname = $name;
38 $extra = "";
40 $last_reason = "Unknown reason";
42 } else {
44 $passfail = $type;
45 $testname = "UNKN";
46 $extra = "Unknown status type $type!";
48 $last_reason = "Unknown reason";
50 }
52 push(@results, ([$testname, $passfail, $extra]));
54 }
56 }
58 foreach $test (@results) {
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 }
70 }