f5330aabcff1a7cec3a4dd58df57cedd29e81614
[p5sagit/p5-mst-13.2.git] / t / TEST
1 #!./perl
2
3 # This is written in a peculiar style, since we're trying to avoid
4 # most of the constructs we'll be testing for.  (This comment is
5 # probably obsolete on the avoidance side, though still currrent
6 # on the peculiarity side.)
7
8 # t/TEST and t/harness need to share code. The logical way to do this would be
9 # to have the common code in a file both require or use. However, t/TEST needs
10 # to still work, to generate test results, even if require isn't working, so
11 # we cannot do that. t/harness has no such restriction, so it is quite
12 # acceptable to have it require t/TEST.
13
14 # In which case, we need to stop t/TEST actually running tests, as all
15 # t/harness needs are its subroutines.
16
17
18 # directories with special sets of test switches
19 my %dir_to_switch =
20     (base => '',
21      comp => '',
22      run => '',
23      '../ext/File-Glob/t' => '-I.. -MTestInit', # FIXME - tests assume t/
24      );
25
26 my %temp_no_core =
27     ('../ext/B-Debug' => 1,
28      '../ext/Compress-Raw-Bzip2' => 1,
29      '../ext/Compress-Raw-Zlib' => 1,
30      '../ext/Devel-PPPort' => 1,
31      '../ext/IO-Compress' => 1,
32      '../ext/IPC-SysV' => 1,
33      '../ext/Math-BigInt' => 1,
34      '../ext/Math-BigRat' => 1,
35      '../ext/MIME-Base64' => 1,
36      '../ext/parent' => 1,
37      '../ext/Pod-Simple' => 1,
38      '../ext/Parse-CPAN-Meta' => 1,
39      '../ext/Tie-RefHash' => 1,
40      '../ext/Time-HiRes' => 1,
41      '../ext/Unicode-Normalize' => 1,
42     );
43
44 if ($::do_nothing) {
45     return 1;
46 }
47
48 # Location to put the Valgrind log.
49 my $Valgrind_Log = 'current.valgrind';
50
51 $| = 1;
52
53 # for testing TEST only
54 #BEGIN { require '../lib/strict.pm'; "strict"->import() };
55 #BEGIN { require '../lib/warnings.pm'; "warnings"->import() };
56
57 delete $ENV{PERL5LIB};
58 delete $ENV{PERLLIB};
59 delete $ENV{PERL5OPT};
60
61 # remove empty elements due to insertion of empty symbols via "''p1'" syntax
62 @ARGV = grep($_,@ARGV) if $^O eq 'VMS';
63 our $show_elapsed_time = $ENV{HARNESS_TIMER} || 0;
64
65 # Cheesy version of Getopt::Std.  We can't replace it with that, because we
66 # can't rely on require working.
67 {
68     my @argv = ();
69     foreach my $idx (0..$#ARGV) {
70         push( @argv, $ARGV[$idx] ), next unless $ARGV[$idx] =~ /^-(\S+)$/;
71         $::benchmark = 1 if $1 eq 'benchmark';
72         $::core    = 1 if $1 eq 'core';
73         $::verbose = 1 if $1 eq 'v';
74         $::torture = 1 if $1 eq 'torture';
75         $::with_utf8 = 1 if $1 eq 'utf8';
76         $::with_utf16 = 1 if $1 eq 'utf16';
77         $::taintwarn = 1 if $1 eq 'taintwarn';
78         $ENV{PERL_CORE_MINITEST} = 1 if $1 eq 'minitest';
79         if ($1 =~ /^deparse(,.+)?$/) {
80             $::deparse = 1;
81             $::deparse_opts = $1;
82         }
83     }
84     @ARGV = @argv;
85 }
86
87 chdir 't' if -f 't/TEST';
88 if (-f 'TEST' && -f 'harness' && -d '../lib') {
89     @INC = '../lib';
90 }
91
92 die "You need to run \"make test\" first to set things up.\n"
93   unless -e 'perl' or -e 'perl.exe' or -e 'perl.pm';
94
95 if ($ENV{PERL_3LOG}) { # Tru64 third(1) tool, see perlhack
96     unless (-x 'perl.third') {
97         unless (-x '../perl.third') {
98             die "You need to run \"make perl.third first.\n";
99         }
100         else {
101             print "Symlinking ../perl.third as perl.third...\n";
102             die "Failed to symlink: $!\n"
103                 unless symlink("../perl.third", "perl.third");
104             die "Symlinked but no executable perl.third: $!\n"
105                 unless -x 'perl.third';
106         }
107     }
108 }
109
110 # check leakage for embedders
111 $ENV{PERL_DESTRUCT_LEVEL} = 2 unless exists $ENV{PERL_DESTRUCT_LEVEL};
112
113 $ENV{EMXSHELL} = 'sh';        # For OS/2
114
115 if ($show_elapsed_time) { require Time::HiRes }
116
117 my %skip = (
118             '.' => 1,
119             '..' => 1,
120             'CVS' => 1,
121             'RCS' => 1,
122             'SCCS' => 1,
123             '.svn' => 1,
124            );
125
126 # Roll your own File::Find!
127 sub _find_tests {
128     my($dir) = @_;
129     opendir DIR, $dir or die "Trouble opening $dir: $!";
130     foreach my $f (sort { $a cmp $b } readdir DIR) {
131         next if $skip{$f};
132
133         my $fullpath = "$dir/$f";
134
135         if (-d $fullpath) {
136             _find_tests($fullpath);
137         } elsif ($f =~ /\.t$/) {
138             push @ARGV, $fullpath;
139         }
140     }
141 }
142
143
144 # Scan the text of the test program to find switches and special options
145 # we might need to apply.
146 sub _scan_test {
147     my($test, $type) = @_;
148
149     open(my $script, "<", $test) or die "Can't read $test.\n";
150     my $first_line = <$script>;
151
152     $first_line =~ tr/\0//d if $::with_utf16;
153
154     my $switch = "";
155     if ($first_line =~ /#!.*\bperl.*\s-\w*([tT])/) {
156         $switch = "-$1";
157     } else {
158         if ($::taintwarn) {
159             # not all tests are expected to pass with this option
160             $switch = '-t';
161         } else {
162             $switch = '';
163         }
164     }
165
166     my $file_opts = "";
167     if ($type eq 'deparse') {
168         # Look for #line directives which change the filename
169         while (<$script>) {
170             $file_opts .= ",-f$3$4"
171               if /^#\s*line\s+(\d+)\s+((\w+)|"([^"]+)")/;
172         }
173     }
174
175     close $script;
176
177     my $perl = './perl';
178     my $lib  = '../lib';
179     my $run_dir;
180     my $return_dir;
181
182     $test =~ /^(.+)\/[^\/]+/;
183     my $dir = $1;
184     my $testswitch = $dir_to_switch{$dir};
185     if (!defined $testswitch) {
186         if ($test =~ s!^(\.\./ext/[^/]+)/t!t!) {
187             $run_dir = $1;
188             $return_dir = '../../t';
189             $lib = '../../lib';
190             $perl = '../../t/perl';
191             $testswitch = "-I../.. -MTestInit=U2T,A";
192             if ($temp_no_core{$run_dir}) {
193                 $testswitch = $testswitch . ',NC';
194             }
195         } else {
196             $testswitch = '-I.. -MTestInit';  # -T will remove . from @INC
197         }
198     }
199
200     my $utf8 = $::with_utf8 ? "-I$lib -Mutf8" : '';
201
202     my %options = (
203         perl => $perl,
204         lib => $lib,
205         test => $test,
206         run_dir => $run_dir,
207         return_dir => $return_dir,
208         testswitch => $testswitch,
209         utf8 => $utf8,
210         file => $file_opts,
211         switch => $switch,
212     );
213
214     return \%options;
215 }
216
217 sub _cmd {
218     my($options, $type) = @_;
219
220     my $test = $options->{test};
221
222     my $cmd;
223     if ($type eq 'deparse') {
224         my $perl = "$options->{perl} $options->{testswitch}";
225         my $lib = $options->{lib};
226
227         $cmd = (
228           "$perl $options->{switch} -I$lib -MO=-qq,Deparse,-sv1.,".
229           "-l$::deparse_opts$options->{file} ".
230           "$test > $test.dp ".
231           "&& $perl $options->{switch} -I$lib $test.dp"
232         );
233     }
234     elsif ($type eq 'perl') {
235         my $perl = $options->{perl};
236         my $redir = $^O eq 'VMS' ? '2>&1' : '';
237
238         if ($ENV{PERL_VALGRIND}) {
239             my $valgrind = $ENV{VALGRIND} // 'valgrind';
240             my $vg_opts = $ENV{VG_OPTS}
241               //  "--suppressions=perl.supp --leak-check=yes "
242                 . "--leak-resolution=high --show-reachable=yes "
243                   . "--num-callers=50";
244             $perl = "$valgrind --log-fd=3 $vg_opts $perl";
245             $redir = "3>$Valgrind_Log";
246         }
247
248         my $args = "$options->{testswitch} $options->{switch} $options->{utf8}";
249         $cmd = $perl . _quote_args($args) . " $test $redir";
250     }
251
252     return $cmd;
253 }
254
255 sub _before_fork {
256     my ($options) = @_;
257
258     if ($options->{run_dir}) {
259         my $run_dir = $options->{run_dir};
260         chdir $run_dir or die "Can't chdir to '$run_dir': $!";
261     }
262
263     return;
264 }
265
266 sub _after_fork {
267     my ($options) = @_;
268
269     if ($options->{return_dir}) {
270         my $return_dir = $options->{return_dir};
271         chdir $return_dir
272            or die "Can't chdir from '$options->{run_dir}' to '$return_dir': $!";
273     }
274
275     return;
276 }
277
278 sub _run_test {
279     my ($test, $type) = @_;
280
281     my $options = _scan_test($test, $type);
282     # $test might have changed if we're in ext/Foo, so don't use it anymore
283     # from now on. Use $options->{test} instead.
284
285     _before_fork($options);
286
287     my $cmd = _cmd($options, $type);
288
289     open(my $results, "$cmd |") or print "can't run '$cmd': $!.\n";
290
291     _after_fork($options);
292
293     # Our environment may force us to use UTF-8, but we can't be sure that
294     # anything we're reading from will be generating (well formed) UTF-8
295     # This may not be the best way - possibly we should unset ${^OPEN} up
296     # top?
297     binmode $results;
298
299     return $results;
300 }
301
302 sub _quote_args {
303     my ($args) = @_;
304     my $argstring = '';
305
306     foreach (split(/\s+/,$args)) {
307        # In VMS protect with doublequotes because otherwise
308        # DCL will lowercase -- unless already doublequoted.
309        $_ = q(").$_.q(") if ($^O eq 'VMS') && !/^\"/ && length($_) > 0;
310        $argstring .= ' ' . $_;
311     }
312     return $argstring;
313 }
314
315 sub _populate_hash {
316     return unless defined $_[0];
317     return map {$_, 1} split /\s+/, $_[0];
318 }
319
320 sub _tests_from_manifest {
321     my ($extensions, $known_extensions) = @_;
322     my %skip;
323     my %extensions = _populate_hash($extensions);
324     my %known_extensions = _populate_hash($known_extensions);
325
326     foreach (keys %known_extensions) {
327         $skip{$_}++ unless $extensions{$_};
328     }
329
330     my @results;
331     my $mani = '../MANIFEST';
332     if (open(MANI, $mani)) {
333         while (<MANI>) {
334             if (m!^(ext/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) {
335                 my $t = $1;
336                 my $extension = $2;
337                 if (!$::core || $t =~ m!^lib/[a-z]!) {
338                     if (defined $extension) {
339                         $extension =~ s!/t$!!;
340                         # XXX Do I want to warn that I'm skipping these?
341                         next if $skip{$extension};
342                         my $flat_extension = $extension;
343                         $flat_extension =~ s!-!/!g;
344                         next if $skip{$flat_extension}; # Foo/Bar may live in Foo-Bar
345                     }
346                     my $path = "../$t";
347                     push @results, $path;
348                     $::path_to_name{$path} = $t;
349                 }
350             }
351         }
352         close MANI;
353     } else {
354         warn "$0: cannot open $mani: $!\n";
355     }
356     return @results;
357 }
358
359 unless (@ARGV) {
360     # base first, as TEST bails out if that can't run
361     # then comp, to validate that require works
362     # then run, to validate that -M works
363     # then we know we can -MTestInit for everything else, making life simpler
364     foreach my $dir (qw(base comp run cmd io re op uni mro)) {
365         _find_tests($dir);
366     }
367     _find_tests("lib") unless $::core;
368     # Config.pm may be broken for make minitest. And this is only a refinement
369     # for skipping tests on non-default builds, so it is allowed to fail.
370     # What we want to to is make a list of extensions which we did not build.
371     my $configsh = '../config.sh';
372     my ($extensions, $known_extensions);
373     if (-f $configsh) {
374         open FH, $configsh or die "Can't open $configsh: $!";
375         while (<FH>) {
376             if (/^extensions=['"](.*)['"]$/) {
377                 $extensions = $1;
378             }
379             elsif (/^known_extensions=['"](.*)['"]$/) {
380                 $known_extensions = $1;
381             }
382         }
383         if (!defined $known_extensions) {
384             warn "No known_extensions line found in $configsh";
385         }
386         if (!defined $extensions) {
387             warn "No extensions line found in $configsh";
388         }
389     }
390     # The "complex" constructions of list return from a subroutine, and push of
391     # a list, might fail if perl is really hosed, but they aren't needed for
392     # make minitest, and the building of extensions will likely also fail if
393     # something is that badly wrong.
394     push @ARGV, _tests_from_manifest($extensions, $known_extensions);
395     unless ($::core) {
396         _find_tests('pod');
397         _find_tests('x2p');
398         _find_tests('porting');
399         _find_tests('japh') if $::torture;
400         _find_tests('t/benchmark') if $::benchmark or $ENV{PERL_BENCHMARK};
401     }
402 }
403
404 if ($::deparse) {
405     _testprogs('deparse', '',   @ARGV);
406 }
407 elsif ($::with_utf16) {
408     for my $e (0, 1) {
409         for my $b (0, 1) {
410             print STDERR "# ENDIAN $e BOM $b\n";
411             my @UARGV;
412             for my $a (@ARGV) {
413                 my $u = $a . "." . ($e ? "l" : "b") . "e" . ($b ? "b" : "");
414                 my $f = $e ? "v" : "n";
415                 push @UARGV, $u;
416                 unlink($u);
417                 if (open(A, $a)) {
418                     if (open(U, ">$u")) {
419                         print U pack("$f", 0xFEFF) if $b;
420                         while (<A>) {
421                             print U pack("$f*", unpack("C*", $_));
422                         }
423                         close(U);
424                     }
425                     close(A);
426                 }
427             }
428             _testprogs('perl', '', @UARGV);
429             unlink(@UARGV);
430         }
431     }
432 }
433 else {
434     _testprogs('perl',    '',   @ARGV);
435 }
436
437 sub _testprogs {
438     my ($type, $args, @tests) = @_;
439
440     print <<'EOT' if ($type eq 'deparse');
441 ------------------------------------------------------------------------------
442 TESTING DEPARSER
443 ------------------------------------------------------------------------------
444 EOT
445
446     $::bad_files = 0;
447
448     foreach my $t (@tests) {
449       unless (exists $::path_to_name{$t}) {
450         my $tname = "t/$t";
451         $::path_to_name{$t} = $tname;
452       }
453     }
454     my $maxlen = 0;
455     foreach (@::path_to_name{@tests}) {
456         s/\.\w+\z/./;
457         my $len = length ;
458         $maxlen = $len if $len > $maxlen;
459     }
460     # + 3 : we want three dots between the test name and the "ok"
461     my $dotdotdot = $maxlen + 3 ;
462     my $valgrind = 0;
463     my $total_files = @tests;
464     my $good_files = 0;
465     my $tested_files  = 0;
466     my $totmax = 0;
467     my %failed_tests;
468
469     while (my $test = shift @tests) {
470         my $test_start_time = $show_elapsed_time ? Time::HiRes::time() : 0;
471
472         if ($test =~ /^$/) {
473             next;
474         }
475         if ($type eq 'deparse') {
476             if ($test eq "comp/redef.t") {
477                 # Redefinition happens at compile time
478                 next;
479             }
480             elsif ($test =~ m{lib/Switch/t/}) {
481                 # B::Deparse doesn't support source filtering
482                 next;
483             }
484         }
485         my $te = $::path_to_name{$test} . '.'
486                     x ($dotdotdot - length($::path_to_name{$test}));
487
488         if ($^O ne 'VMS') {  # defer printing on VMS due to piping bug
489             print $te;
490             $te = '';
491         }
492
493         my $results = _run_test($test, $type);
494
495         my $failure;
496         my $next = 0;
497         my $seen_leader = 0;
498         my $seen_ok = 0;
499         my $trailing_leader = 0;
500         my $max;
501         my %todo;
502         while (<$results>) {
503             next if /^\s*$/; # skip blank lines
504             if (/^1..$/ && ($^O eq 'VMS')) {
505                 # VMS pipe bug inserts blank lines.
506                 my $l2 = <RESULTS>;
507                 if ($l2 =~ /^\s*$/) {
508                     $l2 = <RESULTS>;
509                 }
510                 $_ = '1..' . $l2;
511             }
512             if ($::verbose) {
513                 print $_;
514             }
515             unless (/^\#/) {
516                 if ($trailing_leader) {
517                     # shouldn't be anything following a postfix 1..n
518                     $failure = 'FAILED--extra output after trailing 1..n';
519                     last;
520                 }
521                 if (/^1\.\.([0-9]+)( todo ([\d ]+))?/) {
522                     if ($seen_leader) {
523                         $failure = 'FAILED--seen duplicate leader';
524                         last;
525                     }
526                     $max = $1;
527                     %todo = map { $_ => 1 } split / /, $3 if $3;
528                     $totmax += $max;
529                     $tested_files++;
530                     if ($seen_ok) {
531                         # 1..n appears at end of file
532                         $trailing_leader = 1;
533                         if ($next != $max) {
534                             $failure = "FAILED--expected $max tests, saw $next";
535                             last;
536                         }
537                     }
538                     else {
539                         $next = 0;
540                     }
541                     $seen_leader = 1;
542                 }
543                 else {
544                     if (/^(not )?ok(?: (\d+))?[^\#]*(\s*\#.*)?/) {
545                         unless ($seen_leader) {
546                             unless ($seen_ok) {
547                                 $next = 0;
548                             }
549                         }
550                         $seen_ok = 1;
551                         $next++;
552                         my($not, $num, $extra, $istodo) = ($1, $2, $3, 0);
553                         $num = $next unless $num;
554
555                         if ($num == $next) {
556
557                             # SKIP is essentially the same as TODO for t/TEST
558                             # this still conforms to TAP:
559                             # http://search.cpan.org/dist/TAP/TAP.pod
560                             $extra and $istodo = $extra =~ /#\s*(?:TODO|SKIP)\b/;
561                             $istodo = 1 if $todo{$num};
562
563                             if( $not && !$istodo ) {
564                                 $failure = "FAILED at test $num";
565                                 last;
566                             }
567                         }
568                         else {
569                             $failure ="FAILED--expected test $next, saw test $num";
570                             last;
571                         }
572                     }
573                     elsif (/^Bail out!\s*(.*)/i) { # magic words
574                         die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n");
575                     }
576                     else {
577                         # module tests are allowed extra output,
578                         # because Test::Harness allows it
579                         next if $test =~ /^\W*(ext|lib)\b/;
580                         $failure = "FAILED--unexpected output at test $next";
581                         last;
582                     }
583                 }
584             }
585         }
586         close $results;
587
588         if (not defined $failure) {
589             $failure = 'FAILED--no leader found' unless $seen_leader;
590         }
591
592         if ($ENV{PERL_VALGRIND}) {
593             my @valgrind;
594             if (-e $Valgrind_Log) {
595                 if (open(V, $Valgrind_Log)) {
596                     @valgrind = <V>;
597                     close V;
598                 } else {
599                     warn "$0: Failed to open '$Valgrind_Log': $!\n";
600                 }
601             }
602             if ($ENV{VG_OPTS} =~ /cachegrind/) {
603                 if (rename $Valgrind_Log, "$test.valgrind") {
604                     $valgrind++;
605                 } else {
606                     warn "$0: Failed to create '$test.valgrind': $!\n";
607                 }
608             }
609             elsif (@valgrind) {
610                 my $leaks = 0;
611                 my $errors = 0;
612                 for my $i (0..$#valgrind) {
613                     local $_ = $valgrind[$i];
614                     if (/^==\d+== ERROR SUMMARY: (\d+) errors? /) {
615                         $errors += $1;   # there may be multiple error summaries
616                     } elsif (/^==\d+== LEAK SUMMARY:/) {
617                         for my $off (1 .. 4) {
618                             if ($valgrind[$i+$off] =~
619                                 /(?:lost|reachable):\s+\d+ bytes in (\d+) blocks/) {
620                                 $leaks += $1;
621                             }
622                         }
623                     }
624                 }
625                 if ($errors or $leaks) {
626                     if (rename $Valgrind_Log, "$test.valgrind") {
627                         $valgrind++;
628                     } else {
629                         warn "$0: Failed to create '$test.valgrind': $!\n";
630                     }
631                 }
632             } else {
633                 warn "No valgrind output?\n";
634             }
635             if (-e $Valgrind_Log) {
636                 unlink $Valgrind_Log
637                     or warn "$0: Failed to unlink '$Valgrind_Log': $!\n";
638             }
639         }
640         if ($type eq 'deparse') {
641             unlink "./$test.dp";
642         }
643         if ($ENV{PERL_3LOG}) {
644             my $tpp = $test;
645             $tpp =~ s:^\.\./::;
646             $tpp =~ s:/:_:g;
647             $tpp =~ s:\.t$:.3log:;
648             rename("perl.3log", $tpp) ||
649                 die "rename: perl3.log to $tpp: $!\n";
650         }
651         if (not defined $failure and $next != $max) {
652             $failure="FAILED--expected $max tests, saw $next";
653         }
654
655         if( !defined $failure  # don't mask a test failure
656             and $? )
657         {
658             $failure = "FAILED--non-zero wait status: $?";
659         }
660
661         if (defined $failure) {
662             print "${te}$failure\n";
663             $::bad_files++;
664             if ($test =~ /^base/) {
665                 die "Failed a basic test ($test) -- cannot continue.\n";
666             }
667             ++$failed_tests{$test};
668         }
669         else {
670             if ($max) {
671                 my $elapsed;
672                 if ( $show_elapsed_time ) {
673                     $elapsed = sprintf( " %8.0f ms", (Time::HiRes::time() - $test_start_time) * 1000 );
674                 }
675                 else {
676                     $elapsed = "";
677                 }
678                 print "${te}ok$elapsed\n";
679                 $good_files++;
680             }
681             else {
682                 print "${te}skipped\n";
683                 $tested_files -= 1;
684             }
685         }
686     } # while tests
687
688     if ($::bad_files == 0) {
689         if ($good_files) {
690             print "All tests successful.\n";
691             # XXX add mention of 'perlbug -ok' ?
692         }
693         else {
694             die "FAILED--no tests were run for some reason.\n";
695         }
696     }
697     else {
698         my $pct = $tested_files ? sprintf("%.2f", ($tested_files - $::bad_files) / $tested_files * 100) : "0.00";
699         my $s = $::bad_files == 1 ? "" : "s";
700         warn "Failed $::bad_files test$s out of $tested_files, $pct% okay.\n";
701         for my $test ( sort keys %failed_tests ) {
702             print "\t$test\n";
703         }
704         warn <<'SHRDLU_1';
705 ### Since not all tests were successful, you may want to run some of
706 ### them individually and examine any diagnostic messages they produce.
707 ### See the INSTALL document's section on "make test".
708 SHRDLU_1
709         warn <<'SHRDLU_2' if $good_files / $total_files > 0.8;
710 ### You have a good chance to get more information by running
711 ###   ./perl harness
712 ### in the 't' directory since most (>=80%) of the tests succeeded.
713 SHRDLU_2
714         if (eval {require Config; import Config; 1}) {
715             if ($::Config{usedl} && (my $p = $::Config{ldlibpthname})) {
716                 warn <<SHRDLU_3;
717 ### You may have to set your dynamic library search path,
718 ### $p, to point to the build directory:
719 SHRDLU_3
720                 if (exists $ENV{$p} && $ENV{$p} ne '') {
721                     warn <<SHRDLU_4a;
722 ###   setenv $p `pwd`:\$$p; cd t; ./perl harness
723 ###   $p=`pwd`:\$$p; export $p; cd t; ./perl harness
724 ###   export $p=`pwd`:\$$p; cd t; ./perl harness
725 SHRDLU_4a
726                 } else {
727                     warn <<SHRDLU_4b;
728 ###   setenv $p `pwd`; cd t; ./perl harness
729 ###   $p=`pwd`; export $p; cd t; ./perl harness
730 ###   export $p=`pwd`; cd t; ./perl harness
731 SHRDLU_4b
732                 }
733                 warn <<SHRDLU_5;
734 ### for csh-style shells, like tcsh; or for traditional/modern
735 ### Bourne-style shells, like bash, ksh, and zsh, respectively.
736 SHRDLU_5
737             }
738         }
739     }
740     my ($user,$sys,$cuser,$csys) = times;
741     print sprintf("u=%.2f  s=%.2f  cu=%.2f  cs=%.2f  scripts=%d  tests=%d\n",
742         $user,$sys,$cuser,$csys,$tested_files,$totmax);
743     if ($ENV{PERL_VALGRIND}) {
744         my $s = $valgrind == 1 ? '' : 's';
745         print "$valgrind valgrind report$s created.\n", ;
746     }
747 }
748 exit ($::bad_files != 0);
749
750 # ex: set ts=8 sts=4 sw=4 noet: