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',
31 'Test-ftp-iri-fallback.px',
32 'Test-ftp-iri-recursive.px',
33 'Test-ftp-iri-disabled.px',
34 'Test-HTTP-Content-Disposition-1.px',
35 'Test-HTTP-Content-Disposition-2.px',
36 'Test-HTTP-Content-Disposition.px',
37 'Test-idn-headers.px',
42 'Test-iri-percent.px',
43 'Test-iri-disabled.px',
44 'Test-iri-forced-remote.px',
46 'Test-meta-robots.px',
50 'Test-N--no-content-disposition.px',
51 'Test-N--no-content-disposition-trivial.px',
52 'Test--no-content-disposition.px',
53 'Test--no-content-disposition-trivial.px',
55 'Test-nonexisting-quiet.px',
59 'Test-O-HTTP-Content-Disposition.px',
60 'Test-O--no-content-disposition.px',
61 'Test-O--no-content-disposition-trivial.px',
62 'Test-O-nonexisting.px',
65 'Test-restrict-ascii.px',
66 'Test-Restrict-Lowercase.px',
67 'Test-Restrict-Uppercase.px',
68 'Test--spider-fail.px',
69 'Test--spider-r-HTTP-Content-Disposition.px',
70 'Test--spider-r--no-content-disposition.px',
71 'Test--spider-r--no-content-disposition-trivial.px',
75 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
76 $ENV{$var} = '/dev/null';
81 foreach my $test (@tests) {
82 print "Running $test\n\n";
83 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
84 push @tested, { name => $test, result => $? };
87 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
92 foreach my $test (@tested) {
93 ($test->{result} == 0)
94 ? print GREEN 'pass: '
96 print $test->{name}, "\n";
102 pass => sub { scalar grep $_->{result} == 0, @tested },
103 fail => sub { scalar grep $_->{result} != 0, @tested },
110 "${\scalar @tested} tests were run",
111 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
113 my $len_longest = sub
116 foreach my $line (@lines) {
117 if (length $line > $_) {
130 print $count->('fail')
135 exit $count->('fail');