3 # $Header: TEST,v 4.0 91/03/20 01:40:22 lwall Locked $
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 '#!');
30 while ($test = shift) {
36 print "$te" . '.' x (15 - length($te));
38 open(results,"./$test|") || (print "can't run.\n");
40 open(script,"$test") || die "Can't run $test.\n";
48 open(results,"./perl$switch $test|") || (print "can't run.\n");
57 if (/^1\.\.([0-9]+)/) {
62 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
63 if (/^ok (.*)/ && $1 == $next) {
72 if ($ok && $next == $max) {
76 print "FAILED on test $next\n";
80 die "Failed a basic test--cannot continue.\n";
87 print "All tests successful.\n";
89 die "FAILED--no tests were run for some reason.\n";
93 die "Failed 1 test.\n";
95 die "Failed $bad tests.\n";
98 ($user,$sys,$cuser,$csys) = times;
99 print sprintf("u=%g s=%g cu=%g cs=%g\n",$user,$sys,$cuser,$csys);