Merge branch 'deletelocal' into blead
[p5sagit/p5-mst-13.2.git] / t / TEST
CommitLineData
8d063cd8 1#!./perl
2
8d063cd8 3# This is written in a peculiar style, since we're trying to avoid
1de9afcd 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.)
8d063cd8 7
a687059c 8$| = 1;
9
80ed0dea 10# for testing TEST only
11#BEGIN { require '../lib/strict.pm'; strict->import() };
12#BEGIN { require '../lib/warnings.pm'; warnings->import() };
13
60e23f2f 14# Let tests know they're running in the perl core. Useful for modules
15# which live dual lives on CPAN.
16$ENV{PERL_CORE} = 1;
104393a7 17delete $ENV{PERL5LIB};
60e23f2f 18
cc6ae9e5 19# remove empty elements due to insertion of empty symbols via "''p1'" syntax
20@ARGV = grep($_,@ARGV) if $^O eq 'VMS';
551405c4 21our $show_elapsed_time = $ENV{HARNESS_TIMER} || 0;
cc6ae9e5 22
5d9a6404 23# Cheesy version of Getopt::Std. Maybe we should replace it with that.
80ed0dea 24{
25 my @argv = ();
5d9a6404 26 foreach my $idx (0..$#ARGV) {
b326da91 27 push( @argv, $ARGV[$idx] ), next unless $ARGV[$idx] =~ /^-(\S+)$/;
7019aa11 28 $::benchmark = 1 if $1 eq 'benchmark';
80ed0dea 29 $::core = 1 if $1 eq 'core';
30 $::verbose = 1 if $1 eq 'v';
31 $::torture = 1 if $1 eq 'torture';
32 $::with_utf8 = 1 if $1 eq 'utf8';
33 $::with_utf16 = 1 if $1 eq 'utf16';
80ed0dea 34 $::taintwarn = 1 if $1 eq 'taintwarn';
43651d81 35 $ENV{PERL_CORE_MINITEST} = 1 if $1 eq 'minitest';
485988ae 36 if ($1 =~ /^deparse(,.+)?$/) {
80ed0dea 37 $::deparse = 1;
38 $::deparse_opts = $1;
485988ae 39 }
5d9a6404 40 }
80ed0dea 41 @ARGV = @argv;
8d063cd8 42}
43
378cc40b 44chdir 't' if -f 't/TEST';
45
3e6e8be7 46die "You need to run \"make test\" first to set things up.\n"
196918b0 47 unless -e 'perl' or -e 'perl.exe' or -e 'perl.pm';
4633a7c4 48
7a315204 49if ($ENV{PERL_3LOG}) { # Tru64 third(1) tool, see perlhack
09187cb1 50 unless (-x 'perl.third') {
51 unless (-x '../perl.third') {
52 die "You need to run \"make perl.third first.\n";
53 }
54 else {
55 print "Symlinking ../perl.third as perl.third...\n";
56 die "Failed to symlink: $!\n"
57 unless symlink("../perl.third", "perl.third");
58 die "Symlinked but no executable perl.third: $!\n"
59 unless -x 'perl.third';
60 }
61 }
62}
63
3fb91a5e 64# check leakage for embedders
65$ENV{PERL_DESTRUCT_LEVEL} = 2 unless exists $ENV{PERL_DESTRUCT_LEVEL};
66
4633a7c4 67$ENV{EMXSHELL} = 'sh'; # For OS/2
748a9306 68
24c841ba 69# Roll your own File::Find!
70use TestInit;
71use File::Spec;
28ffa55a 72if ($show_elapsed_time) { require Time::HiRes }
24c841ba 73my $curdir = File::Spec->curdir;
74my $updir = File::Spec->updir;
75
76sub _find_tests {
77 my($dir) = @_;
93e325a7 78 opendir DIR, $dir or die "Trouble opening $dir: $!";
a1886d87 79 foreach my $f (sort { $a cmp $b } readdir DIR) {
f458b6e8 80 next if $f eq $curdir or $f eq $updir or
0b834283 81 $f =~ /^(?:CVS|RCS|SCCS|\.svn)$/;
24c841ba 82
f458b6e8 83 my $fullpath = File::Spec->catfile($dir, $f);
24c841ba 84
f458b6e8 85 _find_tests($fullpath) if -d $fullpath;
86 $fullpath = VMS::Filespec::unixify($fullpath) if $^O eq 'VMS';
87 push @ARGV, $fullpath if $f =~ /\.t$/;
24c841ba 88 }
89}
90
cc6ae9e5 91sub _quote_args {
92 my ($args) = @_;
93 my $argstring = '';
94
95 foreach (split(/\s+/,$args)) {
96 # In VMS protect with doublequotes because otherwise
97 # DCL will lowercase -- unless already doublequoted.
98 $_ = q(").$_.q(") if ($^O eq 'VMS') && !/^\"/ && length($_) > 0;
99 $argstring .= ' ' . $_;
100 }
101 return $argstring;
102}
103
6234cb77 104sub _populate_hash {
105 return map {$_, 1} split /\s+/, $_[0];
106}
107
24c841ba 108unless (@ARGV) {
e1a479c5 109 foreach my $dir (qw(base comp cmd run io op uni mro)) {
f458b6e8 110 _find_tests($dir);
24c841ba 111 }
80ed0dea 112 _find_tests("lib") unless $::core;
6234cb77 113 # Config.pm may be broken for make minitest. And this is only a refinement
114 # for skipping tests on non-default builds, so it is allowed to fail.
115 # What we want to to is make a list of extensions which we did not build.
116 my $configsh = File::Spec->catfile($updir, "config.sh");
117 my %skip;
118 if (-f $configsh) {
119 my (%extensions, %known_extensions);
120 open FH, $configsh or die "Can't open $configsh: $!";
121 while (<FH>) {
122 if (/^extensions=['"](.*)['"]$/) {
123 # Deliberate string interpolation to avoid triggering possible
124 # $1 resetting bugs.
125 %extensions = _populate_hash ("$1");
126 }
127 elsif (/^known_extensions=['"](.*)['"]$/) {
128 %known_extensions = _populate_hash ($1);
129 }
130 }
131 if (%extensions) {
132 if (%known_extensions) {
133 foreach (keys %known_extensions) {
134 $skip{$_}++ unless $extensions{$_};
135 }
136 } else {
137 warn "No known_extensions line found in $configsh";
138 }
139 } else {
140 warn "No extensions line found in $configsh";
141 }
142 }
cc6ae9e5 143 my $mani = File::Spec->catfile($updir, "MANIFEST");
7a315204 144 if (open(MANI, $mani)) {
f458b6e8 145 while (<MANI>) { # similar code in t/harness
e469beda 146 if (m!^(ext/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) {
80ed0dea 147 my $t = $1;
148 my $extension = $2;
149 if (!$::core || $t =~ m!^lib/[a-z]!)
5a6e071d 150 {
6234cb77 151 if (defined $extension) {
152 $extension =~ s!/t$!!;
153 # XXX Do I want to warn that I'm skipping these?
154 next if $skip{$extension};
142f6a0d 155 my $flat_extension = $extension;
6ebb0601 156 $flat_extension =~ s!-!/!g;
157 next if $skip{$flat_extension}; # Foo/Bar may live in Foo-Bar
6234cb77 158 }
80ed0dea 159 my $path = File::Spec->catfile($updir, $t);
73ddec28 160 push @ARGV, $path;
80ed0dea 161 $::path_to_name{$path} = $t;
5a6e071d 162 }
7a315204 163 }
164 }
35d88760 165 close MANI;
7a315204 166 } else {
f458b6e8 167 warn "$0: cannot open $mani: $!\n";
7a315204 168 }
80ed0dea 169 unless ($::core) {
d44161bf 170 _find_tests('pod');
e018f8be 171 _find_tests('x2p');
80ed0dea 172 _find_tests('japh') if $::torture;
7019aa11 173 _find_tests('t/benchmark') if $::benchmark or $ENV{PERL_BENCHMARK};
e018f8be 174 }
8d063cd8 175}
176
80ed0dea 177if ($::deparse) {
f193aa2f 178 _testprogs('deparse', '', @ARGV);
179}
80ed0dea 180elsif ($::with_utf16) {
1de9afcd 181 for my $e (0, 1) {
182 for my $b (0, 1) {
183 print STDERR "# ENDIAN $e BOM $b\n";
184 my @UARGV;
185 for my $a (@ARGV) {
186 my $u = $a . "." . ($e ? "l" : "b") . "e" . ($b ? "b" : "");
187 my $f = $e ? "v" : "n";
188 push @UARGV, $u;
189 unlink($u);
190 if (open(A, $a)) {
191 if (open(U, ">$u")) {
90f6ca78 192 print U pack("$f", 0xFEFF) if $b;
1de9afcd 193 while (<A>) {
194 print U pack("$f*", unpack("C*", $_));
195 }
80ed0dea 196 close(U);
1de9afcd 197 }
80ed0dea 198 close(A);
1de9afcd 199 }
200 }
201 _testprogs('perl', '', @UARGV);
202 unlink(@UARGV);
203 }
204 }
205}
f193aa2f 206else {
f193aa2f 207 _testprogs('perl', '', @ARGV);
485988ae 208}
6ee623d5 209
bb365837 210sub _testprogs {
80ed0dea 211 my ($type, $args, @tests) = @_;
6ee623d5 212
485988ae 213 print <<'EOT' if ($type eq 'deparse');
7a315204 214------------------------------------------------------------------------------
485988ae 215TESTING DEPARSER
7a315204 216------------------------------------------------------------------------------
485988ae 217EOT
218
80ed0dea 219 $::bad_files = 0;
73ddec28 220
cc6ae9e5 221 foreach my $t (@tests) {
80ed0dea 222 unless (exists $::path_to_name{$t}) {
f458b6e8 223 my $tname = File::Spec->catfile('t',$t);
224 $tname = VMS::Filespec::unixify($tname) if $^O eq 'VMS';
225 $::path_to_name{$t} = $tname;
cc6ae9e5 226 }
73ddec28 227 }
908801fe 228 my $maxlen = 0;
80ed0dea 229 foreach (@::path_to_name{@tests}) {
73ddec28 230 s/\.\w+\z/./;
231 my $len = length ;
232 $maxlen = $len if $len > $maxlen;
088b5126 233 }
908801fe 234 # + 3 : we want three dots between the test name and the "ok"
80ed0dea 235 my $dotdotdot = $maxlen + 3 ;
7a834142 236 my $valgrind = 0;
da51b73c 237 my $valgrind_log = 'current.valgrind';
80ed0dea 238 my $total_files = @tests;
239 my $good_files = 0;
240 my $tested_files = 0;
241 my $totmax = 0;
ade55ef4 242 my %failed_tests;
80ed0dea 243
551405c4 244 while (my $test = shift @tests) {
28ffa55a 245 my $test_start_time = $show_elapsed_time ? Time::HiRes::time() : 0;
bb365837 246
bb365837 247 if ($test =~ /^$/) {
248 next;
6ee623d5 249 }
485988ae 250 if ($type eq 'deparse') {
251 if ($test eq "comp/redef.t") {
252 # Redefinition happens at compile time
253 next;
254 }
7a834142 255 elsif ($test =~ m{lib/Switch/t/}) {
485988ae 256 # B::Deparse doesn't support source filtering
257 next;
258 }
259 }
80ed0dea 260 my $te = $::path_to_name{$test} . '.'
261 x ($dotdotdot - length($::path_to_name{$test}));
cc6ae9e5 262
263 if ($^O ne 'VMS') { # defer printing on VMS due to piping bug
264 print $te;
265 $te = '';
266 }
bb365837 267
80ed0dea 268 # XXX DAPM %OVER not defined anywhere
269 # $test = $OVER{$test} if exists $OVER{$test};
7a315204 270
551405c4 271 open(SCRIPT,"<",$test) or die "Can't run $test.\n";
f458b6e8 272 $_ = <SCRIPT>;
273 close(SCRIPT) unless ($type eq 'deparse');
80ed0dea 274 if ($::with_utf16) {
90f6ca78 275 $_ =~ tr/\0//d;
276 }
80ed0dea 277 my $switch;
f458b6e8 278 if (/#!.*\bperl.*\s-\w*([tT])/) {
279 $switch = qq{"-$1"};
280 }
281 else {
80ed0dea 282 if ($::taintwarn) {
b26492ee 283 # not all tests are expected to pass with this option
284 $switch = '"-t"';
285 }
286 else {
287 $switch = '';
288 }
f458b6e8 289 }
6ee623d5 290
485988ae 291 my $file_opts = "";
292 if ($type eq 'deparse') {
293 # Look for #line directives which change the filename
294 while (<SCRIPT>) {
295 $file_opts .= ",-f$3$4"
296 if /^#\s*line\s+(\d+)\s+((\w+)|"([^"]+)")/;
297 }
298 close(SCRIPT);
299 }
7a315204 300
80ed0dea 301 my $utf8 = $::with_utf8 ? '-I../lib -Mutf8' : '';
4343e7c3 302 my $testswitch = '-I. -MTestInit'; # -T will strict . from @INC
485988ae 303 if ($type eq 'deparse') {
80ed0dea 304 my $deparse_cmd =
127212b2 305 "./perl $testswitch $switch -I../lib -MO=-qq,Deparse,-sv1.,".
80ed0dea 306 "-l$::deparse_opts$file_opts ".
7a315204 307 "$test > $test.dp ".
308 "&& ./perl $testswitch $switch -I../lib $test.dp |";
80ed0dea 309 open(RESULTS, $deparse_cmd)
310 or print "can't deparse '$deparse_cmd': $!.\n";
485988ae 311 }
312 elsif ($type eq 'perl') {
a7da9a42 313 my $perl = $ENV{PERL} || './perl';
da51b73c 314 my $redir = $^O eq 'VMS' ? '2>&1' : '';
7a834142 315 if ($ENV{PERL_VALGRIND}) {
4f9287d3 316 my $valgrind = $ENV{VALGRIND} // 'valgrind';
3068023c 317 my $vg_opts = $ENV{VG_OPTS}
318 // "--suppressions=perl.supp --leak-check=yes "
319 . "--leak-resolution=high --show-reachable=yes "
320 . "--num-callers=50";
321 $perl = "$valgrind --log-fd=3 $vg_opts $perl";
da51b73c 322 $redir = "3>$valgrind_log";
7a834142 323 }
80ed0dea 324 my $run = "$perl" . _quote_args("$testswitch $switch $utf8")
325 . " $test $redir|";
be24517c 326 open(RESULTS,$run) or print "can't run '$run': $!.\n";
d638aca2 327 }
9c8d215a 328 # Our environment may force us to use UTF-8, but we can't be sure that
329 # anything we're reading from will be generating (well formed) UTF-8
330 # This may not be the best way - possibly we should unset ${^OPEN} up
331 # top?
332 binmode RESULTS;
d638aca2 333
f458b6e8 334 my $failure;
335 my $next = 0;
336 my $seen_leader = 0;
337 my $seen_ok = 0;
20f82676 338 my $trailing_leader = 0;
80ed0dea 339 my $max;
43fe0836 340 my %todo;
bb365837 341 while (<RESULTS>) {
cc6ae9e5 342 next if /^\s*$/; # skip blank lines
615b7a35 343 if (/^1..$/ && ($^O eq 'VMS')) {
344 # VMS pipe bug inserts blank lines.
345 my $l2 = <RESULTS>;
346 if ($l2 =~ /^\s*$/) {
347 $l2 = <RESULTS>;
348 }
349 $_ = '1..' . $l2;
350 }
80ed0dea 351 if ($::verbose) {
bb365837 352 print $_;
353 }
21c74f43 354 unless (/^\#/) {
20f82676 355 if ($trailing_leader) {
356 # shouldn't be anything following a postfix 1..n
a5890677 357 $failure = 'FAILED--extra output after trailing 1..n';
20f82676 358 last;
359 }
809908f7 360 if (/^1\.\.([0-9]+)( todo ([\d ]+))?/) {
20f82676 361 if ($seen_leader) {
a5890677 362 $failure = 'FAILED--seen duplicate leader';
20f82676 363 last;
364 }
bb365837 365 $max = $1;
f458b6e8 366 %todo = map { $_ => 1 } split / /, $3 if $3;
bb365837 367 $totmax += $max;
80ed0dea 368 $tested_files++;
f458b6e8 369 if ($seen_ok) {
20f82676 370 # 1..n appears at end of file
371 $trailing_leader = 1;
372 if ($next != $max) {
a5890677 373 $failure = "FAILED--expected $max tests, saw $next";
20f82676 374 last;
375 }
376 }
377 else {
378 $next = 0;
379 }
f458b6e8 380 $seen_leader = 1;
bb365837 381 }
382 else {
f458b6e8 383 if (/^(not )?ok(?: (\d+))?[^\#]*(\s*\#.*)?/) {
21c74f43 384 unless ($seen_leader) {
385 unless ($seen_ok) {
20f82676 386 $next = 0;
21c74f43 387 }
37ce32a7 388 }
21c74f43 389 $seen_ok = 1;
20f82676 390 $next++;
f458b6e8 391 my($not, $num, $extra, $istodo) = ($1, $2, $3, 0);
392 $num = $next unless $num;
393
394 if ($num == $next) {
395
eac7c728 396 # SKIP is essentially the same as TODO for t/TEST
397 # this still conforms to TAP:
3722f0dc 398 # http://search.cpan.org/dist/TAP/TAP.pod
eac7c728 399 $extra and $istodo = $extra =~ /#\s*(?:TODO|SKIP)\b/;
21c74f43 400 $istodo = 1 if $todo{$num};
401
402 if( $not && !$istodo ) {
20f82676 403 $failure = "FAILED at test $num";
21c74f43 404 last;
405 }
20f82676 406 }
407 else {
f458b6e8 408 $failure ="FAILED--expected test $next, saw test $num";
20f82676 409 last;
37ce32a7 410 }
f458b6e8 411 }
412 elsif (/^Bail out!\s*(.*)/i) { # magic words
413 die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n");
bb365837 414 }
415 else {
dbf51d07 416 # module tests are allowed extra output,
417 # because Test::Harness allows it
418 next if $test =~ /^\W*(ext|lib)\b/;
a5890677 419 $failure = "FAILED--unexpected output at test $next";
20f82676 420 last;
bb365837 421 }
8d063cd8 422 }
423 }
424 }
bb365837 425 close RESULTS;
20f82676 426
427 if (not defined $failure) {
a5890677 428 $failure = 'FAILED--no leader found' unless $seen_leader;
20f82676 429 }
430
7a834142 431 if ($ENV{PERL_VALGRIND}) {
da51b73c 432 my @valgrind;
433 if (-e $valgrind_log) {
434 if (open(V, $valgrind_log)) {
435 @valgrind = <V>;
436 close V;
437 } else {
438 warn "$0: Failed to open '$valgrind_log': $!\n";
439 }
440 }
3068023c 441 if ($ENV{VG_OPTS} =~ /cachegrind/) {
442 if (rename $valgrind_log, "$test.valgrind") {
443 $valgrind++;
444 } else {
445 warn "$0: Failed to create '$test.valgrind': $!\n";
446 }
447 }
448 elsif (@valgrind) {
d44161bf 449 my $leaks = 0;
450 my $errors = 0;
7a834142 451 for my $i (0..$#valgrind) {
452 local $_ = $valgrind[$i];
d44161bf 453 if (/^==\d+== ERROR SUMMARY: (\d+) errors? /) {
454 $errors += $1; # there may be multiple error summaries
455 } elsif (/^==\d+== LEAK SUMMARY:/) {
456 for my $off (1 .. 4) {
457 if ($valgrind[$i+$off] =~
458 /(?:lost|reachable):\s+\d+ bytes in (\d+) blocks/) {
459 $leaks += $1;
460 }
461 }
7a834142 462 }
463 }
d44161bf 464 if ($errors or $leaks) {
da51b73c 465 if (rename $valgrind_log, "$test.valgrind") {
d44161bf 466 $valgrind++;
467 } else {
468 warn "$0: Failed to create '$test.valgrind': $!\n";
7a834142 469 }
470 }
471 } else {
472 warn "No valgrind output?\n";
473 }
da51b73c 474 if (-e $valgrind_log) {
475 unlink $valgrind_log
476 or warn "$0: Failed to unlink '$valgrind_log': $!\n";
477 }
7a834142 478 }
485988ae 479 if ($type eq 'deparse') {
480 unlink "./$test.dp";
481 }
211f317f 482 if ($ENV{PERL_3LOG}) {
483 my $tpp = $test;
3716a21d 484 $tpp =~ s:^\.\./::;
9c54ecba 485 $tpp =~ s:/:_:g;
3716a21d 486 $tpp =~ s:\.t$:.3log:;
487 rename("perl.3log", $tpp) ||
488 die "rename: perl3.log to $tpp: $!\n";
211f317f 489 }
20f82676 490 if (not defined $failure and $next != $max) {
a5890677 491 $failure="FAILED--expected $max tests, saw $next";
20f82676 492 }
493
343bc60d 494 if( !defined $failure # don't mask a test failure
495 and $? )
496 {
497 $failure = "FAILED--non-zero wait status: $?";
498 }
499
20f82676 500 if (defined $failure) {
501 print "${te}$failure\n";
502 $::bad_files++;
ade55ef4 503 if ($test =~ /^base/) {
504 die "Failed a basic test ($test) -- cannot continue.\n";
20f82676 505 }
ade55ef4 506 ++$failed_tests{$test};
20f82676 507 }
508 else {
bb365837 509 if ($max) {
551405c4 510 my $elapsed;
511 if ( $show_elapsed_time ) {
512 $elapsed = sprintf( " %8.0f ms", (Time::HiRes::time() - $test_start_time) * 1000 );
513 }
514 else {
515 $elapsed = "";
516 }
517 print "${te}ok$elapsed\n";
80ed0dea 518 $good_files++;
bb365837 519 }
520 else {
6b202754 521 print "${te}skipped\n";
80ed0dea 522 $tested_files -= 1;
bb365837 523 }
bcce72a7 524 }
551405c4 525 } # while tests
8d063cd8 526
80ed0dea 527 if ($::bad_files == 0) {
20f82676 528 if ($good_files) {
bb365837 529 print "All tests successful.\n";
530 # XXX add mention of 'perlbug -ok' ?
531 }
532 else {
533 die "FAILED--no tests were run for some reason.\n";
534 }
8d063cd8 535 }
bb365837 536 else {
80ed0dea 537 my $pct = $tested_files ? sprintf("%.2f", ($tested_files - $::bad_files) / $tested_files * 100) : "0.00";
ade55ef4 538 my $s = $::bad_files == 1 ? "" : "s";
539 warn "Failed $::bad_files test$s out of $tested_files, $pct% okay.\n";
540 for my $test ( sort keys %failed_tests ) {
541 print "\t$test\n";
bb365837 542 }
4e4732c1 543 warn <<'SHRDLU_1';
f7d228c6 544### Since not all tests were successful, you may want to run some of
545### them individually and examine any diagnostic messages they produce.
546### See the INSTALL document's section on "make test".
4e4732c1 547SHRDLU_1
80ed0dea 548 warn <<'SHRDLU_2' if $good_files / $total_files > 0.8;
f7d228c6 549### You have a good chance to get more information by running
550### ./perl harness
551### in the 't' directory since most (>=80%) of the tests succeeded.
4e4732c1 552SHRDLU_2
f458b6e8 553 if (eval {require Config; import Config; 1}) {
80ed0dea 554 if ($::Config{usedl} && (my $p = $::Config{ldlibpthname})) {
4e4732c1 555 warn <<SHRDLU_3;
f7d228c6 556### You may have to set your dynamic library search path,
557### $p, to point to the build directory:
4e4732c1 558SHRDLU_3
f458b6e8 559 if (exists $ENV{$p} && $ENV{$p} ne '') {
4e4732c1 560 warn <<SHRDLU_4a;
f7d228c6 561### setenv $p `pwd`:\$$p; cd t; ./perl harness
562### $p=`pwd`:\$$p; export $p; cd t; ./perl harness
563### export $p=`pwd`:\$$p; cd t; ./perl harness
4e4732c1 564SHRDLU_4a
f458b6e8 565 } else {
4e4732c1 566 warn <<SHRDLU_4b;
f7d228c6 567### setenv $p `pwd`; cd t; ./perl harness
568### $p=`pwd`; export $p; cd t; ./perl harness
569### export $p=`pwd`; cd t; ./perl harness
4e4732c1 570SHRDLU_4b
f458b6e8 571 }
4e4732c1 572 warn <<SHRDLU_5;
f7d228c6 573### for csh-style shells, like tcsh; or for traditional/modern
574### Bourne-style shells, like bash, ksh, and zsh, respectively.
4e4732c1 575SHRDLU_5
f458b6e8 576 }
afd33fa9 577 }
bb365837 578 }
80ed0dea 579 my ($user,$sys,$cuser,$csys) = times;
f47304e9 580 print sprintf("u=%.2f s=%.2f cu=%.2f cs=%.2f scripts=%d tests=%d\n",
80ed0dea 581 $user,$sys,$cuser,$csys,$tested_files,$totmax);
7a834142 582 if ($ENV{PERL_VALGRIND}) {
583 my $s = $valgrind == 1 ? '' : 's';
584 print "$valgrind valgrind report$s created.\n", ;
585 }
6ee623d5 586}
80ed0dea 587exit ($::bad_files != 0);
ade55ef4 588
589# ex: set ts=8 sts=4 sw=4 noet: