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