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-disabled.px',
31 'Test-HTTP-Content-Disposition-1.px',
32 'Test-HTTP-Content-Disposition-2.px',
33 'Test-HTTP-Content-Disposition.px',
34 'Test-idn-headers.px',
39 'Test-iri-disabled.px',
40 'Test-iri-forced-remote.px',
45 'Test-N--no-content-disposition.px',
46 'Test-N--no-content-disposition-trivial.px',
47 'Test--no-content-disposition.px',
48 'Test--no-content-disposition-trivial.px',
50 'Test-nonexisting-quiet.px',
54 'Test-O-HTTP-Content-Disposition.px',
55 'Test-O--no-content-disposition.px',
56 'Test-O--no-content-disposition-trivial.px',
57 'Test-O-nonexisting.px',
60 'Test-Restrict-Lowercase.px',
61 'Test-Restrict-Uppercase.px',
62 'Test--spider-fail.px',
63 'Test--spider-r-HTTP-Content-Disposition.px',
64 'Test--spider-r--no-content-disposition.px',
65 'Test--spider-r--no-content-disposition-trivial.px',
69 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
70 $ENV{$var} = '/dev/null';
75 foreach my $test (@tests) {
76 print "Running $test\n\n";
77 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
78 push @tested, { name => $test, result => $? };
81 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
86 foreach my $test (@tested) {
87 ($test->{result} == 0)
88 ? print GREEN 'pass: '
90 print $test->{name}, "\n";
96 pass => sub { scalar grep $_->{result} == 0, @tested },
97 fail => sub { scalar grep $_->{result} != 0, @tested },
104 "${\scalar @tested} tests were run",
105 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
107 my $len_longest = sub
110 foreach my $line (@lines) {
111 if (length $line > $_) {
124 print $count->('fail')
129 exit $count->('fail');