9 die "Please specify the top source directory.\n" if (!@ARGV);
10 my $top_srcdir = shift @ARGV;
14 'Test-auth-no-challenge.px',
15 'Test-auth-no-challenge-url.px',
16 'Test-auth-with-content-disposition.px',
18 'Test-cookies-401.px',
19 'Test-proxy-auth-basic.px',
20 'Test-proxied-https-auth.px',
21 'Test-N-HTTP-Content-Disposition.px',
30 'Test-ftp-pasv-fail.px',
31 'Test-ftp-bad-list.px',
32 'Test-ftp-recursive.px',
34 'Test-ftp-iri-fallback.px',
35 'Test-ftp-iri-recursive.px',
36 'Test-ftp-iri-disabled.px',
37 'Test-HTTP-Content-Disposition-1.px',
38 'Test-HTTP-Content-Disposition-2.px',
39 'Test-HTTP-Content-Disposition.px',
40 'Test-idn-headers.px',
45 'Test-iri-percent.px',
46 'Test-iri-disabled.px',
47 'Test-iri-forced-remote.px',
50 'Test-meta-robots.px',
54 'Test-N--no-content-disposition.px',
55 'Test-N--no-content-disposition-trivial.px',
56 'Test--no-content-disposition.px',
57 'Test--no-content-disposition-trivial.px',
59 'Test-nonexisting-quiet.px',
63 'Test-O-HTTP-Content-Disposition.px',
64 'Test-O--no-content-disposition.px',
65 'Test-O--no-content-disposition-trivial.px',
66 'Test-O-nonexisting.px',
69 'Test-restrict-ascii.px',
70 'Test-Restrict-Lowercase.px',
71 'Test-Restrict-Uppercase.px',
72 'Test--spider-fail.px',
73 'Test--spider-r-HTTP-Content-Disposition.px',
74 'Test--spider-r--no-content-disposition.px',
75 'Test--spider-r--no-content-disposition-trivial.px',
79 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
80 $ENV{$var} = '/dev/null';
85 foreach my $test (@tests) {
86 print "Running $test\n\n";
87 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
88 push @tested, { name => $test, result => $? >> 8 };
91 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
99 unknown => 3, # or greater
103 $exit{pass} => colored('pass:', 'green' ),
104 $exit{fail} => colored('FAIL:', 'red' ),
105 $exit{skip} => colored('Skip:', 'yellow' ),
106 $exit{unknown} => colored('Unknown:', 'magenta'),
110 foreach my $test (@tested) {
111 my $colored = exists $colors{$test->{result}}
112 ? $colors{$test->{result}}
113 : $colors{$exit{unknown}};
114 print "$colored $test->{name}\n";
120 pass => sub { scalar grep $_->{result} == $exit{pass}, @tested },
121 fail => sub { scalar grep $_->{result} == $exit{fail}, @tested },
122 skip => sub { scalar grep $_->{result} == $exit{skip}, @tested },
123 unknown => sub { scalar grep $_->{result} >= $exit{unknown}, @tested },
130 "${\scalar @tested} tests were run",
131 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
132 "${\$count->('skip')} SKIP, ${\$count->('unknown')} UNKNOWN",
134 my $len_longest = sub
137 foreach my $line (@lines) {
138 if (length $line > $_) {
151 print $count->('fail') || $count->('unknown')
152 ? colored($summary, 'red')
153 : colored($summary, 'green');
156 exit $count->('fail') + $count->('unknown');