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