diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-11-24 15:56:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:28:30 -0500 |
commit | 4a127c679dd117a8297e69d9441dc1ff14cc4b6c (patch) | |
tree | 369fefc998b3bc31bee2e27040732639ad37408f /source4/script/subunit-summary | |
parent | 3ac1f590e966df67d6858a1dd482d80369f9f1a0 (diff) | |
download | samba-4a127c679dd117a8297e69d9441dc1ff14cc4b6c.tar.gz samba-4a127c679dd117a8297e69d9441dc1ff14cc4b6c.tar.bz2 samba-4a127c679dd117a8297e69d9441dc1ff14cc4b6c.zip |
r19877: Add simple script for summarizing subunit testresults.
(This used to be commit c38705ef42eff2ea7cd3cf74438713a4a0c4b873)
Diffstat (limited to 'source4/script/subunit-summary')
-rwxr-xr-x | source4/script/subunit-summary | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/source4/script/subunit-summary b/source4/script/subunit-summary new file mode 100755 index 0000000000..f407e20060 --- /dev/null +++ b/source4/script/subunit-summary @@ -0,0 +1,65 @@ +#!/usr/bin/perl +# Simple subunit parser +# (C) 2006 Jelmer Vernooij <jelmer@samba.org> + +use strict; +use Getopt::Long; + +my $numtests = 0; +my $numfails = 0; +my $numskips = 0; +my $numsuccess = 0; + +my $opt_help = 0; +my $opt_progress = 0; + +my $result = GetOptions ( + 'help|h|?' => \$opt_help, + 'progress' => \$opt_progress + ); + +if (not $result) { + exit(1); +} + +if ($opt_help) { + print "subunit output summarizer\n"; + print "Copyright (C) 2006 Jelmer Vernooij <jelmer\@samba.org>\n"; + print "\n"; + print "Usage: subunit-summary [OPTION]\n"; + print " --help Print this help message\n"; + print "\n"; + exit(0); +} + +while(<STDIN>) { + next unless (/^(.+): (.+?)( \[)?$/); + if ($1 eq "test") { + $numtests++; + } elsif ($1 eq "error") { + print "E" if ($opt_progress); + } elsif ($1 eq "failure") { + $numfails++; + print "F" if ($opt_progress); + } elsif ($1 eq "success") { + $numsuccess++; + print "." if ($opt_progress); + } elsif ($1 eq "skip") { + $numskips++; + print "I" if ($opt_progress); + } elsif ($1 eq "testsuite") { + if ($opt_progress) { + if ($numtests) { print "\n"; } + print "$2: "; + } + } +} + +print "\n" if ($opt_progress); + +printf("%d%%: %d tests, %d succeeded, %d failed, %d skipped\n", + ($numsuccess / $numtests * 100), + $numtests, + $numsuccess, + $numfails, + $numskips); |