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',
28 'Test-HTTP-Content-Disposition-1.px',
29 'Test-HTTP-Content-Disposition-2.px',
30 'Test-HTTP-Content-Disposition.px',
34 'Test-N--no-content-disposition.px',
35 'Test-N--no-content-disposition-trivial.px',
36 'Test--no-content-disposition.px',
37 'Test--no-content-disposition-trivial.px',
39 'Test-nonexisting-quiet.px',
43 'Test-O-HTTP-Content-Disposition.px',
44 'Test-O--no-content-disposition.px',
45 'Test-O--no-content-disposition-trivial.px',
46 'Test-O-nonexisting.px',
49 'Test-Restrict-Lowercase.px',
50 'Test-Restrict-Uppercase.px',
51 'Test--spider-fail.px',
52 'Test--spider-r-HTTP-Content-Disposition.px',
53 'Test--spider-r--no-content-disposition.px',
54 'Test--spider-r--no-content-disposition-trivial.px',
58 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
59 $ENV{$var} = '/dev/null';
64 foreach my $test (@tests) {
65 print "Running $test\n\n";
66 system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test");
67 push @tested, { name => $test, result => $? };
70 foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
75 foreach my $test (@tested) {
76 ($test->{result} == 0)
77 ? print GREEN 'pass: '
79 print $test->{name}, "\n";
85 pass => sub { scalar grep $_->{result} == 0, @tested },
86 fail => sub { scalar grep $_->{result} != 0, @tested },
93 "${\scalar @tested} tests were run",
94 "${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
99 foreach my $line (@lines) {
100 if (length $line > $_) {
113 print $count->('fail')
118 exit $count->('fail');