7 use Term::ANSIColor ':constants';
8 $Term::ANSIColor::AUTORESET = 1;
10 die "Please specify the top source directory.\n" if (!@ARGV);
11 my $top_srcdir = shift @ARGV;
15 'Test-auth-no-challenge.px',
16 'Test-auth-no-challenge-url.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-recursive.px',
33 'Test-ftp-iri-fallback.px',
34 'Test-ftp-iri-recursive.px',
35 'Test-ftp-iri-disabled.px',
36 'Test-HTTP-Content-Disposition-1.px',
37 'Test-HTTP-Content-Disposition-2.px',
38 'Test-HTTP-Content-Disposition.px',
39 'Test-idn-headers.px',
44 'Test-iri-percent.px',
45 'Test-iri-disabled.px',
46 'Test-iri-forced-remote.px',
49 'Test-meta-robots.px',
53 'Test-N--no-content-disposition.px',
54 'Test-N--no-content-disposition-trivial.px',
55 'Test--no-content-disposition.px',
56 'Test--no-content-disposition-trivial.px',
58 'Test-nonexisting-quiet.px',
62 'Test-O-HTTP-Content-Disposition.px',
63 'Test-O--no-content-disposition.px',
64 'Test-O--no-content-disposition-trivial.px',
65 'Test-O-nonexisting.px',
68 'Test-restrict-ascii.px',
69 'Test-Restrict-Lowercase.px',
70 'Test-Restrict-Uppercase.px',
71 'Test--spider-fail.px',
72 'Test--spider-r-HTTP-Content-Disposition.px',
73 'Test--spider-r--no-content-disposition.px',
74 'Test--spider-r--no-content-disposition-trivial.px',
78 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
79 $ENV{$var} = '/dev/null';
84 foreach my $test (@tests) {
85 print "Running $test\n\n";
86 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
87 push @tested, { name => $test, result => $? };
90 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
95 foreach my $test (@tested) {
96 ($test->{result} == 0)
97 ? print GREEN 'pass: '
99 print $test->{name}, "\n";
105 pass => sub { scalar grep $_->{result} == 0, @tested },
106 fail => sub { scalar grep $_->{result} != 0, @tested },
113 "${\scalar @tested} tests were run",
114 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
116 my $len_longest = sub
119 foreach my $line (@lines) {
120 if (length $line > $_) {
133 print $count->('fail')
138 exit $count->('fail');