This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to ExtUtils::MakeMaker 6.25
[perl5.git] / lib / ExtUtils / t / hints.t
index 7542bd3..96bb09d 100644 (file)
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+
 BEGIN {
     if( $ENV{PERL_CORE} ) {
         chdir 't';
@@ -7,12 +9,20 @@ BEGIN {
         unshift @INC, 't/lib/';
     }
 }
-$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
+chdir 't';
+
+use File::Spec;
 
 use Test::More tests => 3;
 
-mkdir 'hints';
-my $hint_file = "hints/$^O.pl";
+# Having the CWD in @INC masked a bug in finding hint files
+my $curdir = File::Spec->curdir;
+@INC = grep { $_ ne $curdir && $_ ne '.' } @INC;
+
+mkdir('hints', 0777);
+(my $os = $^O) =~ s/\./_/g;
+my $hint_file = File::Spec->catfile('hints', "$os.pl");
+
 open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
 print HINT <<'CLOO';
 $self->{CCFLAGS} = 'basset hounds got long ears';