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 lib` );
29 push( @ARGV, `dir/s/b nt` );
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 if ($^O eq 'os2' || $^O eq 'qnx' || 1) {
42 open(CONFIG, "../config.sh");
44 if (/sharpbang='(.*)'/) {
45 $sharpbang = ($1 eq '#!');
55 while ($test = shift) {
61 print "$te" . '.' x (18 - length($te));
63 open(results,"./$test |") || (print "can't run.\n");
65 open(script,"$test") || die "Can't run $test.\n";
71 # Must protect uppercase switches with "" on command line
72 $switch =~ s/-([A-Z]\S*)/"-$1"/g;
77 open(results,"perl$switch $test |") || (print "can't run.\n");
87 if (/^1\.\.([0-9]+)/) {
94 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
95 if (/^ok (.*)/ && $1 == $next) {
104 if ($ok && $next == $max) {
109 print "skipping test on this platform\n";
114 print "FAILED on test $next\n";
118 die "Failed a basic test--cannot continue.\n";
125 print "All tests successful.\n";
127 die "FAILED--no tests were run for some reason.\n";
130 $pct = sprintf("%.2f", $good / $total * 100);
132 warn "Failed 1 test script out of $total, $pct% okay.\n";
134 warn "Failed $bad test scripts out of $total, $pct% okay.\n";
137 ### Since not all tests were successful, you may want to run some
138 ### of them individually and examine any diagnostic messages they
139 ### produce. See the INSTALL document's section on "make test".
142 ($user,$sys,$cuser,$csys) = times;
143 print sprintf("u=%g s=%g cu=%g cs=%g scripts=%d tests=%d\n",
144 $user,$sys,$cuser,$csys,$files,$totmax);