2 #***************************************************************************
4 # Project ___| | | | _ \| |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) 1998 - 2014, 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 push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
29 require "getpart.pm"; # array functions
31 my $srcdir = $ENV{'srcdir'} || '.';
32 my $TESTDIR="$srcdir/data";
34 # Get all commands and find out their test numbers
35 opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!";
36 my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
39 my $TESTCASES; # start with no test cases
41 # cut off everything but the digits
43 $_ =~ s/[a-z\/\.]*//g;
45 # the the numbers from low to high
46 for(sort { $a <=> $b } @cmds) {
52 my %k; # keyword count
53 my %t; # keyword to test case mapping
54 my @miss; # test cases without keywords set
60 for $t (split(/ /, $TESTCASES)) {
61 if(loadtest("${TESTDIR}/test${t}")) {
66 my @ec = getpart("verify", "errorcode");
68 # count number of check error codes
69 $errors{ 0 + $ec[0] } ++;
73 my @what = getpart("info", "keywords");
82 #print "Test $t: $_\n";
99 my @a = split(" ", $list);
103 my @l = sort {rand(100) - 50} @a;
113 for (sort {$a <=> $b} @ll) {
123 # sort alphabetically
124 my @mtest = reverse sort { lc($b) cmp lc($a) } keys %k;
127 <table><tr><th>Num</th><th>Keyword</th><th>Test Cases</th></tr>
131 printf "<tr><td>%d</td><td>$t</td><td>%s</td></tr>\n", $k{$t},
134 printf "</table><p> $count out of %d tests (%d lack keywords)\n",
135 scalar(@miss) + $count,
144 printf "<p> %d different error codes tested for:<br>\n",
145 scalar(keys %errors);
147 # numerically on amount, or alphebetically if same amount
148 my @etest = sort { $a <=> $b} keys %errors;