#!./perl # We suppose that perl _mostly_ works at this moment, so may use # sophisticated testing. BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib'; $ENV{PERL5LIB} = '../lib'; # so children will see it too } use lib '../lib'; use Test::Harness; $Test::Harness::switches = ""; # Too much noise otherwise $Test::Harness::verbose = shift if @ARGV && $ARGV[0] eq '-v'; @tests = @ARGV; @tests = unless @tests; Test::Harness::runtests @tests; exit(0) unless -e "../testcompile"; %infinite = qw( op/bop.t 1 lib/hostname.t 1 ); #fudge DATA for now. %datahandle = qw( lib/bigint.t 1 lib/bigintpm.t 1 lib/bigfloat.t 1 lib/bigfloatpm.t 1 ); my $dhwrapper = <<'EOT'; open DATA,"<".__FILE__; until (($_=) =~ /^__END__/) {}; EOT @tests = grep (!$infinite{$_}, @tests); @tests = map { my $new = $_; if ($datahandle{$_}) { $new .= '.t'; local(*F, *T); open(F,"<$_") or die "Can't open $_: $!"; open(T,">$new") or die "Can't open $new: $!"; print T $dhwrapper, ; close F; close T; } $new; } @tests; print "The tests ", join(' ', keys(%infinite)), " generate infinite loops! Skipping!\n"; $ENV{'COMPILE_TEST'} = 1; Test::Harness::runtests @tests; foreach (keys %datahandle) { unlink "$_.t"; }