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';
18 @ARGV = split(/[ \n]/,
19 `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t lib/*.t`);
22 open(CONFIG,"../config.sh");
24 if (/sharpbang='(.*)'/) {
25 $sharpbang = ($1 eq '#!');
32 while ($test = shift) {
38 print "$te" . '.' x (15 - length($te));
40 open(results,"./$test|") || (print "can't run.\n");
42 open(script,"$test") || die "Can't run $test.\n";
50 open(results,"./perl$switch $test|") || (print "can't run.\n");
59 if (/^1\.\.([0-9]+)/) {
66 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
67 if (/^ok (.*)/ && $1 == $next) {
76 if ($ok && $next == $max) {
81 print "FAILED on test $next\n";
85 die "Failed a basic test--cannot continue.\n";
92 print "All tests successful.\n";
94 die "FAILED--no tests were run for some reason.\n";
97 $pct = sprintf("%.2f", $good / $total * 100);
99 warn "Failed 1 test, $pct% okay.\n";
101 die "Failed $bad/$total tests, $pct% okay.\n";
104 ($user,$sys,$cuser,$csys) = times;
105 print sprintf("u=%g s=%g cu=%g cs=%g files=%d tests=%d\n",
106 $user,$sys,$cuser,$csys,$files,$totmax);