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',
42 'Test-idn-headers.px',
47 'Test-iri-percent.px',
48 'Test-iri-disabled.px',
49 'Test-iri-forced-remote.px',
52 'Test-meta-robots.px',
56 'Test-N--no-content-disposition.px',
57 'Test-N--no-content-disposition-trivial.px',
58 'Test--no-content-disposition.px',
59 'Test--no-content-disposition-trivial.px',
61 'Test-nonexisting-quiet.px',
65 'Test-O-HTTP-Content-Disposition.px',
66 'Test-O--no-content-disposition.px',
67 'Test-O--no-content-disposition-trivial.px',
68 'Test-O-nonexisting.px',
71 'Test-restrict-ascii.px',
72 'Test-Restrict-Lowercase.px',
73 'Test-Restrict-Uppercase.px',
74 'Test--spider-fail.px',
75 'Test--spider-r-HTTP-Content-Disposition.px',
76 'Test--spider-r--no-content-disposition.px',
77 'Test--spider-r--no-content-disposition-trivial.px',
81 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
82 $ENV{$var} = '/dev/null';
87 foreach my $test (@tests) {
88 print "Running $test\n\n";
89 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
90 push @tested, { name => $test, result => $? >> 8 };
93 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
101 unknown => 3, # or greater
105 $exit{pass} => colored('pass:', 'green' ),
106 $exit{fail} => colored('FAIL:', 'red' ),
107 $exit{skip} => colored('Skip:', 'yellow' ),
108 $exit{unknown} => colored('Unknown:', 'magenta'),
112 foreach my $test (@tested) {
113 my $colored = exists $colors{$test->{result}}
114 ? $colors{$test->{result}}
115 : $colors{$exit{unknown}};
116 print "$colored $test->{name}\n";
122 pass => sub { scalar grep $_->{result} == $exit{pass}, @tested },
123 fail => sub { scalar grep $_->{result} == $exit{fail}, @tested },
124 skip => sub { scalar grep $_->{result} == $exit{skip}, @tested },
125 unknown => sub { scalar grep $_->{result} >= $exit{unknown}, @tested },
132 "${\scalar @tested} tests were run",
133 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
134 "${\$count->('skip')} SKIP, ${\$count->('unknown')} UNKNOWN",
136 my $len_longest = sub
139 foreach my $line (@lines) {
140 if (length $line > $_) {
153 print $count->('fail') || $count->('unknown')
154 ? colored($summary, 'red')
155 : colored($summary, 'green');
158 exit $count->('fail') + $count->('unknown');