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