Debian lenny version packages
[pkg-perl] / deb-src / libwww-perl / libwww-perl-5.813 / t / TEST
1 #!/usr/local/bin/perl -w
2
3 use strict;
4
5 # This script is run Test::Harness on the tests found under the
6 # "t" directory.
7
8 # First we check if we already are within the "t" directory
9 unless (-d "base") {
10     # try to move into test directory
11     chdir "t" or die "Can't chdir: $!";
12
13     # fix all relative library locations
14     foreach (@INC) {
15         $_ = "../$_" unless m,^([a-z]:)?[/\\],i;
16     }
17 }
18 # Pick up the library files from the ../blib directory
19 unshift(@INC, "../blib/lib", "../blib/arch");
20 #print "@INC\n";
21
22
23 use Test::Harness;
24 $Test::Harness::verbose = shift
25   if defined $ARGV[0] and $ARGV[0] =~ /^\d+$/ || $ARGV[0] eq "-v";
26
27 my @tests;
28
29 if (@ARGV) {
30     for (@ARGV) {
31         if (-d $_) {
32             push(@tests, <$_/*.t>);
33         } else {
34             $_ .= ".t" unless /\.t$/;
35             push(@tests, $_);
36         }
37     }
38 } else {
39     @tests = (<base/*.t>, <html/*.t>, <robot/*.t>, <local/*.t>);
40     push(@tests,  <live/*.t>) if -f "live/ENABLED";
41     push(@tests, <net/*.t>) if -f "net/config.pl";
42 }
43
44 runtests @tests;