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',
17 'Test-proxy-auth-basic.px',
18 'Test-proxied-https-auth.px',
19 'Test-N-HTTP-Content-Disposition.px',
29 'Test-ftp-iri-fallback.px',
30 'Test-ftp-iri-recursive.px',
31 'Test-ftp-iri-disabled.px',
32 'Test-HTTP-Content-Disposition-1.px',
33 'Test-HTTP-Content-Disposition-2.px',
34 'Test-HTTP-Content-Disposition.px',
35 'Test-idn-headers.px',
40 'Test-iri-percent.px',
41 'Test-iri-disabled.px',
42 'Test-iri-forced-remote.px',
44 'Test-meta-robots.px',
48 'Test-N--no-content-disposition.px',
49 'Test-N--no-content-disposition-trivial.px',
50 'Test--no-content-disposition.px',
51 'Test--no-content-disposition-trivial.px',
53 'Test-nonexisting-quiet.px',
57 'Test-O-HTTP-Content-Disposition.px',
58 'Test-O--no-content-disposition.px',
59 'Test-O--no-content-disposition-trivial.px',
60 'Test-O-nonexisting.px',
63 'Test-restrict-ascii.px',
64 'Test-Restrict-Lowercase.px',
65 'Test-Restrict-Uppercase.px',
66 'Test--spider-fail.px',
67 'Test--spider-r-HTTP-Content-Disposition.px',
68 'Test--spider-r--no-content-disposition.px',
69 'Test--spider-r--no-content-disposition-trivial.px',
73 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
74 $ENV{$var} = '/dev/null';
79 foreach my $test (@tests) {
80 print "Running $test\n\n";
81 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
82 push @tested, { name => $test, result => $? };
85 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
90 foreach my $test (@tested) {
91 ($test->{result} == 0)
92 ? print GREEN 'pass: '
94 print $test->{name}, "\n";
100 pass => sub { scalar grep $_->{result} == 0, @tested },
101 fail => sub { scalar grep $_->{result} != 0, @tested },
108 "${\scalar @tested} tests were run",
109 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
111 my $len_longest = sub
114 foreach my $line (@lines) {
115 if (length $line > $_) {
128 print $count->('fail')
133 exit $count->('fail');