2 #***************************************************************************
4 # Project ___| | | | _ \| |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at http://curl.haxx.se/docs/copyright.html.
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
22 ###########################################################################
26 @INC=(@INC, $ENV{'srcdir'}, ".");
28 require "getpart.pm"; # array functions
30 my $srcdir = $ENV{'srcdir'} || '.';
31 my $TESTDIR="$srcdir/data";
33 # Get all commands and find out their test numbers
34 opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!";
35 my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
38 my $TESTCASES; # start with no test cases
40 # cut off everything but the digits
42 $_ =~ s/[a-z\/\.]*//g;
44 # the the numbers from low to high
45 for(sort { $a <=> $b } @cmds) {
51 my %k; # keyword count
52 my %t; # keyword to test case mapping
53 my @miss; # test cases without keywords set
59 for $t (split(/ /, $TESTCASES)) {
60 if(loadtest("${TESTDIR}/test${t}")) {
65 my @ec = getpart("verify", "errorcode");
67 # count number of check error codes
68 $errors{ 0 + $ec[0] } ++;
72 my @what = getpart("info", "keywords");
81 #print "Test $t: $_\n";
98 my @a = split(" ", $list);
102 my @l = sort {rand(100) - 50} @a;
112 for (sort {$a <=> $b} @ll) {
122 # numerically on amount, or alphebetically if same amount
123 my @mtest = reverse sort { $k{$a} <=> $k{$b} || $b cmp $a } keys %k;
126 <table><tr><th>Num</th><th>Keyword</th><th>Test Cases</th></tr>
130 printf "<tr><td>%d</td><td>$t</td><td>%s</td></tr>\n", $k{$t},
133 printf "</table><p> $count out of %d tests (%d lack keywords)\n",
134 scalar(@miss) + $count,
143 printf "<p> %d different error codes tested for:<br>\n",
144 scalar(keys %errors);
146 # numerically on amount, or alphebetically if same amount
147 my @etest = sort { $a <=> $b} keys %errors;