From 1b99c731514ee0cc96f061cedd7325b0a94be362 Mon Sep 17 00:00:00 2001 From: Mike Schilli Date: Tue, 24 Apr 2001 18:29:21 -0700 Subject: [PATCH] MakeMaker 'make test' weirdness -- fix for h2xs provided Message-id: <3AE68AE1.6A981723@perlmeister.com> p4raw-id: //depot/perl@9880 --- utils/h2xs.PL | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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); } -- 1.8.3.1