From: Mike Schilli Date: Wed, 25 Apr 2001 01:29:21 +0000 (-0700) Subject: MakeMaker 'make test' weirdness -- fix for h2xs provided X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b99c731514ee0cc96f061cedd7325b0a94be362;p=p5sagit%2Fp5-mst-13.2.git MakeMaker 'make test' weirdness -- fix for h2xs provided Message-id: <3AE68AE1.6A981723@perlmeister.com> p4raw-id: //depot/perl@9880 --- diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 1e78ec5..afd86b5 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -1842,11 +1842,14 @@ it under the same terms as Perl itself. _RMEND_ close(RM) || die "Can't close $ext$modpname/README: $!\n"; -warn "Writing $ext$modpname/test.pl\n"; -open(EX, ">test.pl") || die "Can't create $ext$modpname/test.pl: $!\n"; +my $testdir = "t"; +my $testfile = "$testdir/1.t"; +mkdir "$testdir" or die "Cannot mkdir $testdir: $!\n"; +warn "Writing $ext$modpname/$testfile\n"; +open EX, ">$testfile" or die "Can't create $ext$modpname/$testfile: $!\n"; print EX <<'_END_'; # Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' +# `make test'. After `make install' it should work as `perl 1.t' ######################### @@ -1867,7 +1870,7 @@ ok(1); # If we made it this far, we're ok. # its man page ( perldoc Test ) for help writing this test script. _END_ -close(EX) || die "Can't close $ext$modpname/test.pl: $!\n"; +close(EX) || die "Can't close $ext$modpname/$testfile: $!\n"; unless ($opt_C) { warn "Writing $ext$modpname/Changes\n"; @@ -1887,7 +1890,7 @@ EOP warn "Writing $ext$modpname/MANIFEST\n"; open(MANI,'>MANIFEST') or die "Can't create MANIFEST: $!"; -my @files = <*>; +my @files = grep { -f } (<*>, ); if (!@files) { eval {opendir(D,'.');}; unless ($@) { @files = readdir(D); closedir(D); }