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 && $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 @ARGV = split(/[ \n]/,
24 `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`);
27 if ($^O eq 'os2' || $^O eq 'qnx') {
31 open(CONFIG, "../config.sh");
33 if (/sharpbang='(.*)'/) {
34 $sharpbang = ($1 eq '#!');
46 while ($test = shift) {
52 print "$te" . '.' x (18 - length($te));
54 -x $test || (print "isn't executable.\n");
55 open(RESULTS,"./$test |") || (print "can't run.\n");
57 open(SCRIPT,"$test") || die "Can't run $test.\n";
63 # Must protect uppercase switches with "" on command line
64 $switch =~ s/-([A-Z]\S*)/"-$1"/g;
69 open(RESULTS,"./perl$switch $test |") || (print "can't run.\n");
78 if (/^1\.\.([0-9]+)/) {
85 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
86 if (/^ok (.*)/ && $1 == $next) {
95 if ($ok && $next == $max) {
100 print "skipping test on this platform\n";
105 print "FAILED at test $next\n";
109 die "Failed a basic test--cannot continue.\n";
116 print "All tests successful.\n";
117 # XXX add mention of 'perlbug -ok' ?
119 die "FAILED--no tests were run for some reason.\n";
122 $pct = sprintf("%.2f", $good / $total * 100);
124 warn "Failed 1 test script out of $total, $pct% okay.\n";
126 warn "Failed $bad test scripts out of $total, $pct% okay.\n";
129 ### Since not all tests were successful, you may want to run some
130 ### of them individually and examine any diagnostic messages they
131 ### produce. See the INSTALL document's section on "make test".
133 warn <<'SHRDLU' if $good / $total > 0.8;
135 ### Since most tests were successful, you have a good chance to
136 ### get information with better granularity by running
138 ### in directory ./t.
141 ($user,$sys,$cuser,$csys) = times;
142 print sprintf("u=%g s=%g cu=%g cs=%g scripts=%d tests=%d\n",
143 $user,$sys,$cuser,$csys,$files,$totmax);