3 # We suppose that perl _mostly_ works at this moment, so may use
4 # sophisticated testing.
8 @INC = '../lib'; # pick up only this build's lib
9 $ENV{PERL5LIB} = '../lib'; # so children will see it too
12 my $torture; # torture testing?
16 $Test::Harness::switches = ""; # Too much noise otherwise
17 $Test::Harness::verbose = shift if @ARGV && $ARGV[0] eq '-v';
19 if ($ARGV[0] eq '-torture') {
24 # Let tests know they're running in the perl core. Useful for modules
25 # which live dual lives on CPAN.
44 foreach (keys %datahandle) {
50 # [.VMS]TEST.COM calls harness with empty arguments, so clean-up @ARGV
51 @ARGV = grep $_ && length( $_ ) => @ARGV;
54 if ($^O eq 'MSWin32') {
55 @tests = map(glob($_),@ARGV);
62 push @tests, <base/*.t>;
63 push @tests, <comp/*.t>;
64 push @tests, <cmd/*.t>;
65 push @tests, <run/*.t>;
66 push @tests, <io/*.t>;
67 push @tests, <op/*.t>;
68 push @tests, <uni/*.t>;
69 push @tests, <lib/*.t>;
70 push @tests, <japh/*.t> if $torture;
71 push @tests, <win32/*.t> if $^O eq 'MSWin32';
73 my $updir = File::Spec->updir;
74 my $mani = File::Spec->catfile(File::Spec->updir, "MANIFEST");
75 if (open(MANI, $mani)) {
76 while (<MANI>) { # similar code in t/TEST
77 if (m!^(ext/\S+/?(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) {
78 push @tests, File::Spec->catfile($updir, $1);
83 warn "$0: cannot open $mani: $!\n";
85 push @tests, <pod/*.t>;
86 push @tests, <x2p/*.t>;
89 if ($^O eq 'MSWin32') {
92 Test::Harness::runtests @tests;
93 exit(0) unless -e "../testcompile";
102 my $dhwrapper = <<'EOT';
103 open DATA,"<".__FILE__;
104 until (($_=<DATA>) =~ /^__END__/) {};
107 @tests = grep (!$infinite{$_}, @tests);
110 if ($datahandle{$_} && !( -f "$new.t") ) {
113 open(F,"<$_") or die "Can't open $_: $!";
114 open(T,">$new") or die "Can't open $new: $!";
115 print T $dhwrapper, <F>;
122 print "The tests ", join(' ', keys(%infinite)),
123 " generate infinite loops! Skipping!\n";
125 $ENV{'HARNESS_COMPILE_TEST'} = 1;
126 $ENV{'PERLCC_TIMEOUT'} = 120 unless $ENV{'PERLCC_TIMEOUT'};
128 Test::Harness::runtests @tests;
129 foreach (keys %datahandle) {