Permalink
Browse files

skip PPM tests if IO::File is too old

git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13683 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information...
1 parent d5f1e91 commit 6fb99594830704a7a4902d145db11613bddcd955 @xdg xdg committed Dec 17, 2009
Showing with 14 additions and 25 deletions.
  1. +5 −1 Changes
  2. +4 −1 lib/Module/Build/PPMMaker.pm
  3. +4 −1 t/ppm.t
  4. +1 −22 t/runthrough.t
View
@@ -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
@@ -3,6 +3,8 @@ package Module::Build::PPMMaker;
use strict;
use Config;
use vars qw($VERSION);
+use IO::File;
+
$VERSION = '0.35_15';
$VERSION = eval $VERSION;
@@ -101,8 +103,9 @@ EOF
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;
View
@@ -7,6 +7,7 @@ use Config;
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 $tmp;
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} ) {
View
@@ -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 @@ SKIP: {
}
}
-{
- # 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, a.u.thor@a.galaxy.far.far.away</AUTHOR>
- <IMPLEMENTATION>
- <REQUIRE NAME="File::Spec" VERSION="0" />
- <CODEBASE HREF="/path/to/codebase" />
- </IMPLEMENTATION>
-</SOFTPKG>
-EOF
-}
-
eval {$mb->dispatch('realclean')};
is $@, '';

0 comments on commit 6fb9959

Please sign in to comment.