hv_fetchs() support
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / hints.t
index 391b9f7..96bb09d 100644 (file)
@@ -11,10 +11,18 @@ BEGIN {
 }
 chdir 't';
 
-use Test::More tests => 2;
+use File::Spec;
+
+use Test::More tests => 3;
+
+# 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");
 
-mkdir 'hints';
-my $hint_file = "hints/$^O.pl";
 open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
 print HINT <<'CLOO';
 $self->{CCFLAGS} = 'basset hounds got long ears';
@@ -30,8 +38,17 @@ $mm->check_hints;
 is( $mm->{CCFLAGS}, 'basset hounds got long ears' );
 is( $out->read, "Processing hints file $hint_file\n" );
 
-package Catch;
+open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
+print HINT <<'CLOO';
+die "Argh!\n";
+CLOO
+close HINT;
 
+$mm->check_hints;
+is( $out->read, <<OUT, 'hint files produce errors' );
+Processing hints file $hint_file
+Argh!
+OUT
 
 END {
     use File::Path;