3 # Last change: Fri Jan 10 09:57:03 WET 1997
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';
17 die "You need to run \"make test\" first to set things up.\n"
18 unless -e 'perl' or -e 'perl.exe';
20 $ENV{EMXSHELL} = 'sh'; # For OS/2
23 push( @ARGV, `dir/s/b base` );
24 push( @ARGV, `dir/s/b comp` );
25 push( @ARGV, `dir/s/b cmd` );
26 push( @ARGV, `dir/s/b io` );
27 push( @ARGV, `dir/s/b op` );
28 push( @ARGV, `dir/s/b pragma` );
29 push( @ARGV, `dir/s/b lib` );
32 @ARGV = grep( /\.t$/, @ARGV );
33 grep( s/.*t\\//, @ARGV );
34 # @ARGV = split(/[ \n]/,
35 # `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`);
38 @ARGV = map(glob($_),@ARGV);
42 if ($^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'qnx' || 1) {
46 open(CONFIG, "../config.sh");
48 if (/sharpbang='(.*)'/) {
49 $sharpbang = ($1 eq '#!');
59 while ($test = shift) {
65 print "$te" . '.' x (18 - length($te));
67 open(results,"./$test |") || (print "can't run.\n");
69 open(script,"$test") || die "Can't run $test.\n";
75 # Must protect uppercase switches with "" on command line
76 $switch =~ s/-([A-Z]\S*)/"-$1"/g;
81 open(results,"perl$switch $test |") || (print "can't run.\n");
91 if (/^1\.\.([0-9]+)/) {
98 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
99 if (/^ok (.*)/ && $1 == $next) {
108 if ($ok && $next == $max) {
113 print "skipping test on this platform\n";
118 print "FAILED on test $next\n";
122 die "Failed a basic test--cannot continue.\n";
129 print "All tests successful.\n";
131 die "FAILED--no tests were run for some reason.\n";
134 $pct = sprintf("%.2f", $good / $total * 100);
136 warn "Failed 1 test script out of $total, $pct% okay.\n";
138 warn "Failed $bad test scripts out of $total, $pct% okay.\n";
141 ### Since not all tests were successful, you may want to run some
142 ### of them individually and examine any diagnostic messages they
143 ### produce. See the INSTALL document's section on "make test".
146 ($user,$sys,$cuser,$csys) = times;
147 print sprintf("u=%g s=%g cu=%g cs=%g scripts=%d tests=%d\n",
148 $user,$sys,$cuser,$csys,$files,$totmax);