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',
47 'Test-N--no-content-disposition.px',
48 'Test-N--no-content-disposition-trivial.px',
49 'Test--no-content-disposition.px',
50 'Test--no-content-disposition-trivial.px',
52 'Test-nonexisting-quiet.px',
56 'Test-O-HTTP-Content-Disposition.px',
57 'Test-O--no-content-disposition.px',
58 'Test-O--no-content-disposition-trivial.px',
59 'Test-O-nonexisting.px',
62 'Test-Restrict-Lowercase.px',
63 'Test-Restrict-Uppercase.px',
64 'Test--spider-fail.px',
65 'Test--spider-r-HTTP-Content-Disposition.px',
66 'Test--spider-r--no-content-disposition.px',
67 'Test--spider-r--no-content-disposition-trivial.px',
71 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
72 $ENV{$var} = '/dev/null';
77 foreach my $test (@tests) {
78 print "Running $test\n\n";
79 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
80 push @tested, { name => $test, result => $? };
83 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
88 foreach my $test (@tested) {
89 ($test->{result} == 0)
90 ? print GREEN 'pass: '
92 print $test->{name}, "\n";
98 pass => sub { scalar grep $_->{result} == 0, @tested },
99 fail => sub { scalar grep $_->{result} != 0, @tested },
106 "${\scalar @tested} tests were run",
107 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
109 my $len_longest = sub
112 foreach my $line (@lines) {
113 if (length $line > $_) {
126 print $count->('fail')
131 exit $count->('fail');