3 # $Header: TEST,v 3.0.1.3 91/01/11 18:28:17 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]/,`echo base.* comp.* cmd.* io.* op.* lib.*`);
21 open(CONFIG,"../config.sh");
23 if (/sharpbang='(.*)'/) {
24 $sharpbang = ($1 eq '#!');
29 while ($test = shift) {
30 if ($test =~ /\.orig$/) {
33 if ($test =~ /\.rej$/) {
39 print "$test" . '.' x (16 - length($test));
41 open(results,"./$test|") || (print "can't run.\n");
43 open(script,"$test") || die "Can't run $test.\n";
51 open(results,"./perl$switch $test|") || (print "can't run.\n");
60 if (/^1\.\.([0-9]+)/) {
65 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
66 if (/^ok (.*)/ && $1 == $next) {
75 if ($ok && $next == $max) {
79 print "FAILED on test $next\n";
83 die "Failed a basic test--cannot continue.\n";
90 print "All tests successful.\n";
92 die "FAILED--no tests were run for some reason.\n";
96 die "Failed 1 test.\n";
98 die "Failed $bad tests.\n";
101 ($user,$sys,$cuser,$csys) = times;
102 print sprintf("u=%g s=%g cu=%g cs=%g\n",$user,$sys,$cuser,$csys);