3 # $RCSfile: TEST,v $$Revision: 4.1 $$Date: 92/08/07 18:27:00 $
5 # This is written in a peculiar style, since we're trying to avoid
6 # most of the constructs we'll be testing for.
10 if ($ARGV[0] eq '-v') {
15 chdir 't' if -f 't/TEST';
17 die "You need to run \"make test\" first to set things up.\n"
18 unless -e 'perl' or -e 'perl.exe';
20 $ENV{EMXSHELL} = 'sh'; # For OS/2
23 @ARGV = split(/[ \n]/,
24 `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t lib/*.t`);
27 open(CONFIG,"../config.sh");
29 if (/sharpbang='(.*)'/) {
30 $sharpbang = ($1 eq '#!');
34 $sharpbang = 0 if $ENV{OS2_SHELL}; # OS/2
38 while ($test = shift) {
44 print "$te" . '.' x (15 - length($te));
46 open(results,"./$test |") || (print "can't run.\n");
48 open(script,"$test") || die "Can't run $test.\n";
56 open(results,"./perl$switch $test |") || (print "can't run.\n");
65 if (/^1\.\.([0-9]+)/) {
72 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
73 if (/^ok (.*)/ && $1 == $next) {
82 if ($ok && $next == $max) {
87 print "skipping test on this platform\n";
92 print "FAILED on test $next\n";
96 die "Failed a basic test--cannot continue.\n";
103 print "All tests successful.\n";
105 die "FAILED--no tests were run for some reason.\n";
108 $pct = sprintf("%.2f", $good / $total * 100);
110 warn "Failed 1 test, $pct% okay.\n";
112 die "Failed $bad/$total tests, $pct% okay.\n";
115 ($user,$sys,$cuser,$csys) = times;
116 print sprintf("u=%g s=%g cu=%g cs=%g files=%d tests=%d\n",
117 $user,$sys,$cuser,$csys,$files,$totmax);