3 # $Header: TEST,v 2.0 88/06/05 00:11:47 root Exp $
5 # This is written in a peculiar style, since we're trying to avoid
6 # most of the constructs we'll be testing for.
8 if ($ARGV[0] eq '-v') {
13 chdir 't' if -f 't/TEST';
16 @ARGV = split(/[ \n]/,`echo base.* comp.* cmd.* io.* op.*`);
19 open(config,"../config.sh");
21 if (/sharpbang='(.*)'/) {
22 $sharpbang = ($1 eq '#!');
27 while ($test = shift) {
28 if ($test =~ /\.orig$/) {
33 open(results,"./$test|") || (print "can't run.\n");
35 open(script,"$test") || die "Can't run $test.\n";
43 open(results,"./perl$switch $test|") || (print "can't run.\n");
52 if (/^1\.\.([0-9]+)/) {
57 if (/^ok (.*)/ && $1 == $next) {
66 if ($ok && $next == $max) {
70 print "FAILED on test $next\n";
74 die "Failed a basic test--cannot continue.\n";
81 print "All tests successful.\n";
83 die "FAILED--no tests were run for some reason.\n";
87 die "Failed 1 test.\n";
89 die "Failed $bad tests.\n";
92 ($user,$sys,$cuser,$csys) = times;
93 print sprintf("u=%g s=%g cu=%g cs=%g\n",$user,$sys,$cuser,$csys);