diff options
author | emellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com> | 2005-11-07 12:36:16 +0100 |
---|---|---|
committer | emellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com> | 2005-11-07 12:36:16 +0100 |
commit | 3ec891fe7b48750d20f1fbf425d155487c0fa0c8 (patch) | |
tree | 23bcedcbfda1412c6da5ee4f355820856ba64605 /tools/xm-test/mkreport | |
parent | 27be16e320fac3b64bb579102f065fbf7ee22b1f (diff) | |
download | xen-3ec891fe7b48750d20f1fbf425d155487c0fa0c8.tar.gz xen-3ec891fe7b48750d20f1fbf425d155487c0fa0c8.tar.bz2 xen-3ec891fe7b48750d20f1fbf425d155487c0fa0c8.zip |
Wholesale import of xm-test 0.4.0.
This is not yet integrated with the rest of the Xen build system.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/xm-test/mkreport')
-rw-r--r-- | tools/xm-test/mkreport | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tools/xm-test/mkreport b/tools/xm-test/mkreport new file mode 100644 index 0000000000..24c4270f20 --- /dev/null +++ b/tools/xm-test/mkreport @@ -0,0 +1,71 @@ +#!/usr/bin/perl + +open(LOG, $ARGV[0]); +@lines = <LOG>; + +foreach $line (@lines) { + if ($line =~ /^[A-Z]+/) { + chomp($line); + ($type, @rest) = split(/:/, $line); + + $message = ""; + foreach $chunk (@rest) { + $message .= $chunk; + } + + if ($type eq "REASON") { + + $last_reason = $message ; + + } elsif ($type =~ /X?FAIL/) { + + $rest[0] =~ /([^\. ]+)\.test/; + $name = $1; + + $passfail = $type; + $testname = $name; + $extra = "\n\t$last_reason\n"; + + $last_reason = "Unknown reason"; + + } elsif ($type =~ /X?PASS/) { + + $rest[0] =~ /([^\. ]+)\.test/; + $name = $1; + + $passfail = $type; + $testname = $name; + $extra = ""; + + $last_reason = "Unknown reason"; + + } else { + + $passfail = $type; + $testname = "UNKN"; + $extra = "Unknown status type $type!"; + + $last_reason = "Unknown reason"; + + } + + push(@results, ([$testname, $passfail, $extra])); + + } + +} + +foreach $test (@results) { + + + if ($tests{$test->[0]} eq undef) { + if ($test->[1] =~ /^X?FAIL/) { + $fmt = "%5s: %s %s\n"; + printf($fmt, $test->[1], $test->[0], $test->[2]); + } + $tests{$test->[0]} = 1; + } + + +} + |