minor edits, report the test cases without keywords

This commit is contained in:
Daniel Stenberg 2005-04-16 23:15:12 +00:00
parent 8182d17ae1
commit 0bf9a5704b
1 changed files with 10 additions and 2 deletions

View File

@ -53,6 +53,8 @@ my %k; # keyword count
my %t; # keyword to test case mapping my %t; # keyword to test case mapping
my @miss; # test cases without keywords set my @miss; # test cases without keywords set
my $count;
for $t (split(/ /, $TESTCASES)) { for $t (split(/ /, $TESTCASES)) {
if(loadtest("${TESTDIR}/test${t}")) { if(loadtest("${TESTDIR}/test${t}")) {
# bad case # bad case
@ -62,6 +64,7 @@ for $t (split(/ /, $TESTCASES)) {
if(!$what[0]) { if(!$what[0]) {
push @miss, $t; push @miss, $t;
next;
} }
for(@what) { for(@what) {
@ -70,9 +73,11 @@ for $t (split(/ /, $TESTCASES)) {
$k{$_}++; $k{$_}++;
$t{$_} .= "$_ "; $t{$_} .= "$_ ";
} }
$count++;
} }
my @mtest = reverse sort { $k{$a} <=> $k{$b} } keys %k; # numerically on amount, or alphebetically if same amount
my @mtest = reverse sort { $k{$a} <=> $k{$b} || $b cmp $a } keys %k;
print <<TOP print <<TOP
<table><tr><th>No Tests</th><th>Keyword</th></tr> <table><tr><th>No Tests</th><th>Keyword</th></tr>
@ -81,8 +86,11 @@ TOP
for $t (@mtest) { for $t (@mtest) {
printf "<tr><td>%d</td><td>$t</td></tr>\n", $k{$t}; printf "<tr><td>%d</td><td>$t</td></tr>\n", $k{$t};
} }
print "</table>\n"; printf "</table><p> $count tests (%d lack keywords)\n",
scalar(@miss);
for(@miss) { for(@miss) {
print STDERR "$_ "; print STDERR "$_ ";
} }
print STDERR "\n";