Skip to content

Commit

Permalink
Fixes for failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqs committed Sep 9, 2020
1 parent ef47444 commit 1ad172c
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 33 deletions.
14 changes: 12 additions & 2 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,21 @@
"runtime" : {
"recommends" : {
"IO::Compress::Lzma" : "2.096",
"IO::Uncompress::UnLzma" : "2.096"
"IO::Uncompress::UnLzma" : "2.096",
"IO::Compress::Xz" : "2.096",
"IO::Uncompress::UnXz" : "2.096",
"IO::Compress::Zstd" : "2.096",
"IO::Uncompress::UnZstd" : "2.096",
"IO::Compress::Bzip2" : "2.096",
"IO::Uncompress::Bunzip2" : "2.096"
},
"requires" : {
"IO::Compress::Base" : "2.096",
"IO::Uncompress::Base" : "2.096",
"IO::Compress::Zip" : "2.096",
"IO::Uncompress::Unzip" : "2.096",
"IO::Compress::RawDeflate" : "2.096",
"IO::Uncompress::RawInflate" : "2.096",
"Perl::OSType" : "0"
}
}
Expand All @@ -56,6 +66,6 @@
"web" : "https://github.com/pmqs/Archive-Zip-SimpleZip"
}
},
"version" : "0.038",
"version" : "0.039",
"x_serialization_backend" : "JSON::PP version 2.27300"
}
12 changes: 11 additions & 1 deletion META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@ no_index:
recommends:
IO::Compress::Lzma: '2.096'
IO::Uncompress::UnLzma: '2.096'
IO::Compress::Xz: '2.096'
IO::Uncompress::UnXz: '2.096'
IO::Compress::Zstd: '2.096'
IO::Uncompress::UnZstd: '2.096'
IO::Compress::Bzip2: '2.096'
IO::Uncompress::Bunzip2: '2.096'
requires:
IO::Compress::Base: '2.096'
IO::Uncompress::Base: '2.096'
IO::Compress::Zip: '2.096'
IO::Uncompress::Unzip: '2.096'
IO::Compress::RawDeflate: '2.096'
IO::Uncompress::RawInflate: '2.096'
Perl::OSType: '0'
resources:
bugtracker: https://github.com/pmqs/Archive-Zip-SimpleZip/issues
homepage: https://github.com/pmqs/Archive-Zip-SimpleZip
repository: git://github.com/pmqs/Archive-Zip-SimpleZip.git
version: '0.038'
version: '0.039'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
30 changes: 23 additions & 7 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ use ExtUtils::MakeMaker 5.16 ;

my $ParentVersion = 2.096 ;

# Check if IO::Compress::Lzna is installed.
# If it is, add to PREREQ_PM.
# Check if th eother IO::Compress::* modules are installed.
# If any are, add to PREREQ_PM.
my %extra_prereq = ();
$extra_prereq{'IO::Compress::Lzma'} = $ParentVersion
if eval { require IO::Compress::Lzma; 1 } ;
$extra_prereq{'IO::Compress::Bzip2'} = $ParentVersion
if eval { require IO::Compress::Bzip2; 1 } ;
$extra_prereq{'IO::Compress::Xz'} = $ParentVersion
if eval { require IO::Compress::Xz; 1 } ;
$extra_prereq{'IO::Compress::Zstd'} = $ParentVersion
if eval { require IO::Compress::Zstd; 1 } ;

WriteMakefile(
NAME => 'Archive::Zip::SimpleZip',
Expand Down Expand Up @@ -70,13 +76,23 @@ WriteMakefile(
prereqs => {
runtime => {
requires => {
'IO::Compress::Base' => $ParentVersion,
'IO::Uncompress::Base' => $ParentVersion,
'Perl::OSType' => 0,
'IO::Compress::Base' => $ParentVersion,
'IO::Uncompress::Base' => $ParentVersion,
'IO::Compress::Zip' => $ParentVersion,
'IO::Uncompress::Umzip' => $ParentVersion,
'IO::Compress::RawDeflate' => $ParentVersion,
'IO::Uncompress::RawInflate'=> $ParentVersion,
'Perl::OSType' => 0,
},
recommends => {
'IO::Compress::Lzma' => $ParentVersion,
'IO::Uncompress::UnLzma' => $ParentVersion,
'IO::Compress::Lzma' => $ParentVersion,
'IO::Uncompress::UnLzma' => $ParentVersion,
'IO::Compress::Zstd' => $ParentVersion,
'IO::Uncompress::UnZstd' => $ParentVersion,
'IO::Compress::Bzip2' => $ParentVersion,
'IO::Uncompress::Bunzip2' => $ParentVersion,
'IO::Compress::Xz' => $ParentVersion,
'IO::Uncompress::UnXz' => $ParentVersion,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Archive-Zip-SimpleZip

Version 0.038
Version 0.039

7 September 2020
8 September 2020

Copyright (c) 2012-2020 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it
Expand Down
2 changes: 1 addition & 1 deletion lib/Archive/Zip/SimpleUnzip.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require Exporter ;

our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $SimpleUnzipError);

$VERSION = '0.038';
$VERSION = '0.039';
$SimpleUnzipError = '';

@ISA = qw(IO::Uncompress::Unzip Exporter);
Expand Down
2 changes: 1 addition & 1 deletion lib/Archive/Zip/SimpleZip.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $SimpleZipError);

$SimpleZipError= '';
$VERSION = "0.038";
$VERSION = "0.039";

@ISA = qw(Exporter);
@EXPORT_OK = qw( $SimpleZipError ) ;
Expand Down
2 changes: 1 addition & 1 deletion lib/Archive/Zip/StreamedUnzip.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require Exporter ;

our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $StreamedUnzipError);

$VERSION = '0.038';
$VERSION = '0.039';
$StreamedUnzipError = '';

@ISA = qw(IO::Uncompress::Unzip Exporter);
Expand Down
4 changes: 4 additions & 0 deletions t/000prereq.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ BEGIN
my @NAMES = qw(
IO::Compress::Zip
IO::Uncompress::Unzip
IO::Compress::RawDeflate
IO::Uncompress::RawInflate
);

my @OPT = qw(
IO::Compress::Bzip2
IO::Uncompress::Bunzip2
IO::Compress::Lzma
IO::Uncompress::UnLzma
IO::Compress::Xz
Expand Down
46 changes: 28 additions & 18 deletions t/010main-unzip.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,31 @@ BEGIN {
use_ok('Archive::Zip::SimpleZip', qw($SimpleZipError ZIP_CM_DEFLATE ZIP_CM_BZIP2 ZIP_CM_STORE ZIP_CM_LZMA ZIP_CM_XZ ZIP_CM_ZSTD)) ;
use_ok('Archive::Zip::SimpleUnzip', qw($SimpleUnzipError)) ;

eval{ require IO::Uncompress::Adapter::UnLzma ;
import IO::Uncompress::Adapter::UnLzma } ;
}

eval{ require IO::Uncompress::Adapter::UnXz ;
import IO::Uncompress::Adapter::UnXz } ;
eval ' use IO::Uncompress::Bunzip2 2.096 ;';
eval ' use IO::Uncompress::RawInflate 2.096 ;';
eval ' use IO::Uncompress::UnLzma 2.096 ;';
eval ' use IO::Uncompress::UnXz 2.096 ;';
eval ' use IO::Uncompress::UnZstd 2.096 ;';

eval{ require IO::Uncompress::Adapter::UnZstd ;
import IO::Uncompress::Adapter::UnZstd } ;
my %methodNames;

# eval { require Encode ; import Encode }
#use_ok('Encode');
}
$methodNames{ZIP_CM_STORE()} = 'Store';
$methodNames{ZIP_CM_DEFLATE()} = 'Deflate' ;
$methodNames{ZIP_CM_BZIP2()} = 'Bzip2' ;
$methodNames{ZIP_CM_LZMA()} = 'LZMA' ;
$methodNames{ZIP_CM_XZ()} = 'XZ' ;
$methodNames{ZIP_CM_ZSTD()} = 'ZSTD' ;

my %methodsAvailable;

$methodsAvailable{ZIP_CM_STORE()} = 'Store';
$methodsAvailable{ZIP_CM_DEFLATE()} = 'Deflate' if defined $IO::Uncompress::RawInflate::VERSION;
$methodsAvailable{ZIP_CM_BZIP2()} = 'Bzip2' if defined $IO::Uncompress::Bunzip2::VERSION ;
$methodsAvailable{ZIP_CM_LZMA()} = 'LZMA' if defined $IO::Uncompress::UnLzma::VERSION ;
$methodsAvailable{ZIP_CM_XZ()} = 'XZ' if defined $IO::Uncompress::UnXz::VERSION ;
$methodsAvailable{ZIP_CM_ZSTD()} = 'ZSTD' if defined $IO::Uncompress::UnZstd::VERSION ;

my $symlink_exists = eval { symlink("", ""); 1 } ;

Expand Down Expand Up @@ -308,19 +321,16 @@ if (1)
SKIP:
for my $zip64 (0, 1)
{
title "** TO $to, Method $method, Comment '$comment', Streamed $streamed. Zip64 $zip64";
my $methodName = $methodsAvailable{$method} || '';

skip "Skipping LZMA tests", 213
if $method == ZIP_CM_LZMA && ! defined $IO::Uncompress::Adapter::UnLzma::VERSION ;
title "** TO $to, Method $method, Comment '$comment', Streamed $streamed. Zip64 $zip64";

skip "Skipping XZ tests", 213
if $method == ZIP_CM_XZ && ! defined $IO::Uncompress::Adapter::UnXz::VERSION ;
skip "Skipping method $methodNames{$method} ($method): No uncompressor installed", 213
if ! $methodName ;

skip "Skipping ZSTD tests", 213
if $method == ZIP_CM_ZSTD && ! defined $IO::Uncompress::Adapter::UnZstd::VERSION ;
skip "Skipping Zstd with Streaming", 213
if $method == ZIP_CM_ZSTD && $streamed;

skip "Skipping Streaming tests with ZSTD tests", 213
if $streamed && $method == ZIP_CM_ZSTD && defined $IO::Uncompress::Adapter::UnZstd::VERSION ;

my $lex = new LexFile my $name2 ;
my $output;
Expand Down
1 change: 1 addition & 0 deletions t/020main-unzip-stream.t
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ if (1)
my $methodName = $methodsAvailable{$method} || '';

title "** TO $to, Method $methodName($method), Comment '$comment', Streamed $streamed. Zip64 $zip64";

skip "Skipping method $methodNames{$method} ($method): No uncompressor installed", 85
if ! $methodName && $method == ZIP_CM_ZSTD ;

Expand Down

0 comments on commit 1ad172c

Please sign in to comment.