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