This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add xsubpp and libnetcfg to installed *.bat files for win32 builds
[perl5.git] / t / harness
CommitLineData
a5f75d66
AD
1#!./perl
2
3# We suppose that perl _mostly_ works at this moment, so may use
4# sophisticated testing.
5
aa689395
PP
6BEGIN {
7 chdir 't' if -d 't';
93430cb4 8 unshift @INC, '../lib';
ef712cf7 9 $ENV{PERL5LIB} = '../lib'; # so children will see it too
aa689395 10}
a5f75d66 11use lib '../lib';
aa689395 12
a5f75d66
AD
13use Test::Harness;
14
ef712cf7 15$Test::Harness::switches = ""; # Too much noise otherwise
90ce63d5 16$Test::Harness::verbose = shift if @ARGV && $ARGV[0] eq '-v';
a5f75d66 17
0ca04487
VB
18#fudge DATA for now.
19%datahandle = qw(
20 lib/bigint.t 1
21 lib/bigintpm.t 1
22 lib/bigfloat.t 1
23 lib/bigfloatpm.t 1
24 op/gv.t 1
25 lib/complex.t 1
26 lib/ph.t 1
27 lib/soundex.t 1
28 op/misc.t 1
29 op/runlevel.t 1
30 op/tie.t 1
31 op/lex_assign.t 1
0ca04487
VB
32 );
33
34foreach (keys %datahandle) {
35 unlink "$_.t";
36}
37
7a315204
JH
38if (@ARGV) {
39 @tests = @ARGV;
40} else {
b695f709 41 unless (@tests) {
5ebfc105 42 @tests = <base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t lib/*.t>;
b695f709
JH
43 use File::Spec;
44 my $updir = File::Spec->updir;
45 my $mani = File::Spec->catdir(File::Spec->updir, "MANIFEST");
46 if (open(MANI, $mani)) {
47 while (<MANI>) { # similar code in t/TEST
48 if (m!^(ext/\S+/([^/]+\.t|test\.pl)|lib/\S+?(\.t|test\.pl))\s!) {
49 push @tests, File::Spec->catdir($updir, $1);
50 }
7a315204 51 }
b695f709
JH
52 } else {
53 warn "$0: cannot open $mani: $!\n";
7a315204 54 }
b695f709 55 push @tests, <pod/*.t>;
7a315204
JH
56 }
57}
52cebf5e 58
a5f75d66 59Test::Harness::runtests @tests;
56eca212
GS
60exit(0) unless -e "../testcompile";
61
e4f0d88d
EP
62# %infinite = qw (
63# op/bop.t 1
64# lib/hostname.t 1
65# op/lex_assign.t 1
595ae481 66# lib/ph.t 1
e4f0d88d 67# );
56eca212
GS
68
69my $dhwrapper = <<'EOT';
70open DATA,"<".__FILE__;
71until (($_=<DATA>) =~ /^__END__/) {};
72EOT
52cebf5e
EP
73
74@tests = grep (!$infinite{$_}, @tests);
56eca212 75@tests = map {
ef712cf7 76 my $new = $_;
adac82c7 77 if ($datahandle{$_} && !( -f "$new.t") ) {
ef712cf7
EP
78 $new .= '.t';
79 local(*F, *T);
80 open(F,"<$_") or die "Can't open $_: $!";
81 open(T,">$new") or die "Can't open $new: $!";
82 print T $dhwrapper, <F>;
83 close F;
84 close T;
85 }
86 $new;
87 } @tests;
88
89print "The tests ", join(' ', keys(%infinite)),
90 " generate infinite loops! Skipping!\n";
91
595ae481 92$ENV{'HARNESS_COMPILE_TEST'} = 1;
9636a016 93$ENV{'PERLCC_TIMEOUT'} = 120 unless $ENV{'PERLCC_TIMEOUT'};
ef712cf7 94
595ae481 95Test::Harness::runtests @tests;
56eca212
GS
96foreach (keys %datahandle) {
97 unlink "$_.t";
52cebf5e 98}