From: Nicholas Clark Date: Mon, 13 May 2002 21:45:47 +0000 (+0100) Subject: Re: FreeBSD mostly OK. [nwc10@colon.colondot.net: Report /export/home/nwc10/Even... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ccc70a53db4bdfe62527deb9e4c30f19764f9afb;p=p5sagit%2Fp5-mst-13.2.git Re: FreeBSD mostly OK. [nwc10@colon.colondot.net: Report /export/home/nwc10/Even-Smoke/Smoke] Message-ID: <20020513204546.GC310@Bagpuss.unfortu.net> p4raw-id: //depot/perl@16584 --- diff --git a/lib/ExtUtils/t/Constant.t b/lib/ExtUtils/t/Constant.t index d321b20..34f9414 100644 --- a/lib/ExtUtils/t/Constant.t +++ b/lib/ExtUtils/t/Constant.t @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -print "1..48\n"; +print "1..51\n"; BEGIN { if( $ENV{PERL_CORE} ) { @@ -509,6 +509,14 @@ EOT close FH or die "close $makefilePL: $!\n"; +################ MANIFEST +# We really need a MANIFEST because make distclean checks it. +my $manifest = catfile($dir, "MANIFEST"); +push @files, "MANIFEST"; +open FH, ">$manifest" or die "open >$manifest: $!\n"; +print FH "$_\n" foreach @files; +close FH or die "close $manifest: $!\n"; + chdir $dir or die $!; push @INC, '../../lib'; END {chdir ".." or warn $!}; @@ -529,8 +537,9 @@ if (-f "$makefile$makefile_ext") { } else { print "not ok 2\n"; } -my $makefile_rename = ($^O eq 'VMS' ? '.mms' : '.old'); -push @files, "$makefile$makefile_rename"; # Renamed by make clean + +# Renamed by make clean +my $makefile_rename = $makefile . ($^O eq 'VMS' ? '.mms' : '.old'); my $make = $Config{make}; @@ -568,8 +577,6 @@ if ($Config{usedl}) { } } -push @files, $output; - my $maketest = "$make test"; print "# make = '$maketest'\n"; @@ -639,22 +646,52 @@ if ($?) { } $test++; -unless ($keep_files) { - foreach (@files) { - unlink $_ or warn "unlink $_: $!"; +sub check_for_bonus_files { + my $dir = shift; + my %expect = map {$_, 1} @_; + + my $fail; + opendir DIR, $dir or die "opendir '$dir': $!"; + while (defined (my $entry = readdir DIR)) { + next if $expect{$entry}; + print "# Extra file '$entry'\n"; + $fail = 1; } -} -my $fail; -opendir DIR, "." or die "opendir '.': $!"; -while (defined (my $entry = readdir DIR)) { - next if $entry =~ /^\.\.?$/; - print "# Extra file '$entry'\n"; - $fail = 1; + closedir DIR or warn "closedir '.': $!"; + if ($fail) { + print "not ok $test\n"; + } else { + print "ok $test\n"; + } + $test++; } -closedir DIR or warn "closedir '.': $!"; -if ($fail) { - print "not ok $test\n"; + +check_for_bonus_files ('.', @files, $output, $makefile_rename, '.', '..'); + +rename $makefile_rename, $makefile + or die "Can't rename '$makefile_rename' to '$makefile': $!"; + +unlink $output or warn "Can't unlink '$output': $!"; + +# Need to make distclean to remove ../../lib/ExtTest.pm +my $makedistclean = "$make distclean"; +print "# make = '$makedistclean'\n"; +@makeout = `$makedistclean`; +if ($?) { + print "not ok $test # $make failed: $?\n"; + print "# $_" foreach @makeout; } else { print "ok $test\n"; } +$test++; + +check_for_bonus_files ('.', @files, '.', '..'); + +unless ($keep_files) { + foreach (@files) { + unlink $_ or warn "unlink $_: $!"; + } +} + +check_for_bonus_files ('.', '.', '..');