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',
17 'Test-auth-retcode.px',
19 'Test-cookies-401.px',
20 'Test-proxy-auth-basic.px',
21 'Test-proxied-https-auth.px',
22 'Test-N-HTTP-Content-Disposition.px',
31 'Test-ftp-pasv-fail.px',
32 'Test-ftp-bad-list.px',
33 'Test-ftp-recursive.px',
35 'Test-ftp-iri-fallback.px',
36 'Test-ftp-iri-recursive.px',
37 'Test-ftp-iri-disabled.px',
38 'Test-HTTP-Content-Disposition-1.px',
39 'Test-HTTP-Content-Disposition-2.px',
40 'Test-HTTP-Content-Disposition.px',
43 'Test-idn-headers.px',
48 'Test-iri-percent.px',
49 'Test-iri-disabled.px',
50 'Test-iri-forced-remote.px',
53 'Test-meta-robots.px',
57 'Test-N--no-content-disposition.px',
58 'Test-N--no-content-disposition-trivial.px',
59 'Test--no-content-disposition.px',
60 'Test--no-content-disposition-trivial.px',
62 'Test-nonexisting-quiet.px',
66 'Test-O-HTTP-Content-Disposition.px',
67 'Test-O--no-content-disposition.px',
68 'Test-O--no-content-disposition-trivial.px',
69 'Test-O-nonexisting.px',
72 'Test-restrict-ascii.px',
73 'Test-Restrict-Lowercase.px',
74 'Test-Restrict-Uppercase.px',
75 'Test--spider-fail.px',
76 'Test--spider-r-HTTP-Content-Disposition.px',
77 'Test--spider-r--no-content-disposition.px',
78 'Test--spider-r--no-content-disposition-trivial.px',
82 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
83 $ENV{$var} = '/dev/null';
88 foreach my $test (@tests) {
89 print "Running $test\n\n";
90 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
91 push @tested, { name => $test, result => $? >> 8 };
94 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
102 unknown => 3, # or greater
106 $exit{pass} => colored('pass:', 'green' ),
107 $exit{fail} => colored('FAIL:', 'red' ),
108 $exit{skip} => colored('Skip:', 'yellow' ),
109 $exit{unknown} => colored('Unknown:', 'magenta'),
113 foreach my $test (@tested) {
114 my $colored = exists $colors{$test->{result}}
115 ? $colors{$test->{result}}
116 : $colors{$exit{unknown}};
117 print "$colored $test->{name}\n";
123 pass => sub { scalar grep $_->{result} == $exit{pass}, @tested },
124 fail => sub { scalar grep $_->{result} == $exit{fail}, @tested },
125 skip => sub { scalar grep $_->{result} == $exit{skip}, @tested },
126 unknown => sub { scalar grep $_->{result} >= $exit{unknown}, @tested },
133 "${\scalar @tested} tests were run",
134 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
135 "${\$count->('skip')} SKIP, ${\$count->('unknown')} UNKNOWN",
137 my $len_longest = sub
140 foreach my $line (@lines) {
141 if (length $line > $_) {
154 print $count->('fail') || $count->('unknown')
155 ? colored($summary, 'red')
156 : colored($summary, 'green');
159 exit $count->('fail') + $count->('unknown');