Upgrade to ExtUtils::MakeMaker 6.52
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / 00compile.t
index 5eb015b..7d06484 100644 (file)
@@ -21,19 +21,21 @@ BEGIN {
 
 chdir File::Spec->updir;
 my $manifest = File::Spec->catfile('MANIFEST');
-open(MANIFEST, $manifest) or die "Can't open $manifest: $!";
+open(my $manifest_fh, "<", $manifest) or die "Can't open $manifest: $!";
 my @modules = map { m{^lib/(\S+)}; $1 } 
-              grep { m{^lib/ExtUtils/\S*\.pm}  } <MANIFEST>;
+              grep { m{^lib/ExtUtils/\S*\.pm} } 
+              grep { !m{/t/} } <$manifest_fh>;
 chomp @modules;
-close MANIFEST;
+close $manifest_fh;
 
 chdir 'lib';
 plan tests => scalar @modules * 2;
 foreach my $file (@modules) {
-    # 5.8.0 has a bug about require alone in an eval.  Thus the extra
-    # statement.
-    eval { require($file); 1 };
-    is( $@, '', "require $file" );
+    # Make sure we look at the local files and do not reload them if
+    # they're already loaded.  This avoids recompilation warnings.
+    local @INC = @INC;
+    unshift @INC, ".";
+    ok eval { require($file); 1 } or diag "require $file failed.\n$@";
 
     SKIP: {
         skip "Test::Pod not installed", 1 unless $Has_Test_Pod;