[rt.cpan.org #28537] PATCH for croak.t test failure
Slaven_Rezic [Sun, 29 Jul 2007 05:10:46 +0000 (01:10 -0400)]
From: Slaven_Rezic via RT <bug-Storable@rt.cpan.org>
Message-Id: <rt-3.6.HEAD-28249-1185700244-992.28537-4-0@rt.cpan.org>

"The attached patch solves a possible failure in the croak.t
test. It seems that in some version Config.pm pre-loads Carp.pm,
causing the test to fail. The patch just makes sure that
Config.pm is only loaded when building Storable within core
perl."

p4raw-id: //depot/perl@31664

ext/Storable/t/croak.t

index 57c51c0..96c7cb3 100644 (file)
@@ -10,10 +10,13 @@ sub BEGIN {
        chdir('t') if -d 't';
        @INC = ('.', '../lib');
     }
-    require Config; import Config;
-    if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
-        print "1..0 # Skip: Storable was not built\n";
-        exit 0;
+    if ($ENV{PERL_CORE}) {
+       require Config; import Config;
+       %Config=%Config if 0; # cease -w
+       if ($Config{'extensions'} !~ /\bStorable\b/) {
+           print "1..0 # Skip: Storable was not built\n";
+           exit 0;
+       }
     }
 }