Author: dagolden
Date: Thu Dec 17 14:39:29 2009
New Revision: 13683

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/PPMMaker.pm
   Module-Build/trunk/t/ppm.t
   Module-Build/trunk/t/runthrough.t

Log:
skip PPM tests if IO::File is too old

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Thu Dec 17 14:39:29 2009
@@ -1,6 +1,10 @@
 Revision history for Perl extension Module::Build.
 
-0.35_15 - 
+0.35_15 -
+
+ Bug fixes:
+
+ - Make sure PPM tests are skipped if IO::File is too old
 
 0.35_14 - Thu Dec 17 16:02:14 EST 2009
 

Modified: Module-Build/trunk/lib/Module/Build/PPMMaker.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/PPMMaker.pm     (original)
+++ Module-Build/trunk/lib/Module/Build/PPMMaker.pm     Thu Dec 17 14:39:29 2009
@@ -3,6 +3,8 @@
 use strict;
 use Config;
 use vars qw($VERSION);
+use IO::File;
+
 $VERSION = '0.35_15';
 $VERSION = eval $VERSION;
 
@@ -101,8 +103,9 @@
   my $fh = IO::File->new(">$ppd_file")
     or die "Cannot write to $ppd_file: $!";
 
+  my $io_file_ok = eval { IO::File->VERSION(1.13); 1 };
   $fh->binmode(":utf8")
-    if $fh->can('binmode') && $] >= 5.008 && $Config{useperlio};
+    if $io_file_ok && $fh->can('binmode') && $] >= 5.008 && $Config{useperlio};
   print $fh $ppd;
   close $fh;
 

Modified: Module-Build/trunk/t/ppm.t
==============================================================================
--- Module-Build/trunk/t/ppm.t  (original)
+++ Module-Build/trunk/t/ppm.t  Thu Dec 17 14:39:29 2009
@@ -7,6 +7,7 @@
 
 blib_load('Module::Build');
 blib_load('Module::Build::ConfigData');
+my $PPM_support = Module::Build::ConfigData->feature('manpage_support');
 my $manpage_support = Module::Build::ConfigData->feature('manpage_support');
 my $HTML_support = Module::Build::ConfigData->feature('HTML_support');
 
@@ -16,8 +17,10 @@
   my ($have_c_compiler, $tmp_exec) = check_compiler();
   if ( ! $have_c_compiler ) {
     plan skip_all => 'No compiler found';
+  } elsif ( ! $PPM_support ) {
+    plan skip_all => 'PPM support modules not installed';
   } elsif ( !$Config{usedl} ) {
-    plan skip_all => 'Perl not compiled for dynamic loading'
+    plan skip_all => 'Perl not compiled for dynamic loading';
   } elsif ( ! $HTML_support )  {
     plan skip_all => "HTML support not installed";
   } elsif ( ! eval {require Archive::Tar} ) {

Modified: Module-Build/trunk/t/runthrough.t
==============================================================================
--- Module-Build/trunk/t/runthrough.t   (original)
+++ Module-Build/trunk/t/runthrough.t   Thu Dec 17 14:39:29 2009
@@ -2,7 +2,7 @@
 
 use strict;
 use lib 't/lib';
-use MBTest tests => 30;
+use MBTest tests => 29;
 
 blib_load('Module::Build');
 blib_load('Module::Build::ConfigData');
@@ -160,27 +160,6 @@
   }
 }
 
-{
-  # Check PPD
-  $mb->dispatch('ppd', args => {codebase => '/path/to/codebase'});
-
-  my $ppd = slurp('Simple.ppd');
-
-  # This test is quite a hack since with XML you don't really want to
-  # do a strict string comparison, but absent an XML parser it's the
-  # best we can do.
-  is $ppd, <<'EOF';
-<SOFTPKG NAME="Simple" VERSION="0.01">
-    <ABSTRACT>Perl extension for blah blah blah</ABSTRACT>
-    <AUTHOR>A. U. Thor, [email protected]</AUTHOR>
-    <IMPLEMENTATION>
-        <REQUIRE NAME="File::Spec" VERSION="0" />
-        <CODEBASE HREF="/path/to/codebase" />
-    </IMPLEMENTATION>
-</SOFTPKG>
-EOF
-}
-
 
 eval {$mb->dispatch('realclean')};
 is $@, '';

Reply via email to