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