[svn:Module-Build] r12912 - Module-Build/trunk/t

[email protected]
Newsgroups perl.module.build.checkins
Message-ID <[email protected]>
Author: dagolden
Date: Fri Jun 26 04:03:53 2009
New Revision: 12912

Modified:
   Module-Build/trunk/t/par.t

Log:
skip a par.t test if Archive::Zip is broken

Modified: Module-Build/trunk/t/par.t
==============================================================================
--- Module-Build/trunk/t/par.t	(original)
+++ Module-Build/trunk/t/par.t	Fri Jun 26 04:03:53 2009
@@ -73,12 +73,27 @@
 my $distname = $dist->name;
 ok( $filename =~ /^\Q$distname\E/, 'Distribution name seems correct' );
 
-my $meta;
-eval { $meta = PAR::Dist::get_meta($filename) };
+#--------------------------------------------------------------------------#
+# must work around broken Archive::Zip (1.28) which breaks PAR::Dist
+#--------------------------------------------------------------------------#
 
-ok(
-  (not $@ and defined $meta and not $meta eq ''),
-  'Distribution contains META.yml'
-);
+SKIP: {
+  my $zip = Archive::Zip->new;
+  my $tmp2 = MBTest->tmpdir;
+  local %SIG;
+  $SIG{__WARN__} = sub { print STDERR $_[0] unless $_[0] =~ /\bstat\b/ };
+  skip "broken Archive::Zip", 1 
+    unless $zip->read($filename) == Archive::Zip::AZ_OK()
+    && $zip->extractTree('', "$tmp2/") == Archive::Zip::AZ_OK()
+    && -r File::Spec->catfile( $tmp2, 'blib', 'META.yml' );
+
+  my $meta;
+  eval { $meta = PAR::Dist::get_meta($filename) };
+
+  ok(
+    (not $@ and defined $meta and not $meta eq ''),
+    'Distribution contains META.yml'
+  );
+}
 
 $dist->remove;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.