3 # This is written in a peculiar style, since we're trying to avoid
4 # 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]/,
17 `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t lib/*.t`);
20 open(CONFIG,"../foo.sh");
22 if (/sharpbang='(.*)'/) {
23 $sharpbang = ($1 eq '#!');
28 while ($test = shift) {
34 print "$te" . '.' x (15 - length($te));
36 open(results,"./$test|") || (print "can't run.\n");
38 open(script,"$test") || die "Can't run $test.\n";
46 open(results,"./perl$switch $test|") || (print "can't run.\n");
55 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 files=%d tests=%d\n",
100 $user,$sys,$cuser,$csys,$files,$totmax);