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