aboutsummaryrefslogtreecommitdiff
path: root/tests/keywords.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-04-22 22:29:48 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-04-22 22:29:48 +0000
commitc12159ce21141d5374fbc32b73c0ae760826826e (patch)
tree363a8ef5fc9deecb606028ed77702cff2ef07fd5 /tests/keywords.pl
parent4485503ecce619bc970347f2686d03bb54ab0725 (diff)
show up to 5 (random) test cases using the keyword
Diffstat (limited to 'tests/keywords.pl')
-rwxr-xr-xtests/keywords.pl33
1 files changed, 30 insertions, 3 deletions
diff --git a/tests/keywords.pl b/tests/keywords.pl
index 2c83b546f..620317d73 100755
--- a/tests/keywords.pl
+++ b/tests/keywords.pl
@@ -71,20 +71,47 @@ for $t (split(/ /, $TESTCASES)) {
chomp;
#print "Test $t: $_\n";
$k{$_}++;
- $t{$_} .= "$_ ";
+ $t{$_} .= "$t ";
}
$count++;
}
+sub show {
+ my ($list)=@_;
+ my @a = split(" ", $list);
+ my $ret;
+
+ my $c;
+ my @l = sort {rand(100) - 50} @a;
+ my @ll;
+
+ for(1 .. 6) {
+ my $v = shift @l;
+ if($v) {
+ push @ll, $v;
+ }
+ }
+
+ for (sort {$a <=> $b} @ll) {
+ if($c++ == 5) {
+ $ret .= "...";
+ last;
+ }
+ $ret .= "$_ ";
+ }
+ return $ret;
+}
+
# numerically on amount, or alphebetically if same amount
my @mtest = reverse sort { $k{$a} <=> $k{$b} || $b cmp $a } keys %k;
print <<TOP
-<table><tr><th>No Tests</th><th>Keyword</th></tr>
+<table><tr><th>Num</th><th>Keyword</th><th>Test Cases</th></tr>
TOP
;
for $t (@mtest) {
- printf "<tr><td>%d</td><td>$t</td></tr>\n", $k{$t};
+ printf "<tr><td>%d</td><td>$t</td><td>%s</td></tr>\n", $k{$t},
+ show($t{$t});
}
printf "</table><p> $count tests (%d lack keywords)\n",
scalar(@miss);