r31745 - in /trunk/libtest-base-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/Test/ t/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Sun Mar 8 22:55:29 UTC 2009
Author: ansgar-guest
Date: Sun Mar 8 22:55:26 2009
New Revision: 31745
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31745
Log:
* New upstream release.
+ debian/copyright: Update years of copyright.
+ Recommend libtest-deep-perl.
+ Build-depend on libtest-deep-perl and libtest-tester-perl for additional
tests.
* Add myself to Uploaders.
Added:
trunk/libtest-base-perl/MANIFEST.SKIP
trunk/libtest-base-perl/t/deep.t
trunk/libtest-base-perl/t/expected-zero.t
trunk/libtest-base-perl/t/exported_func.t
trunk/libtest-base-perl/t/run_is_deep.t
Modified:
trunk/libtest-base-perl/Changes
trunk/libtest-base-perl/MANIFEST
trunk/libtest-base-perl/META.yml
trunk/libtest-base-perl/Makefile.PL
trunk/libtest-base-perl/README
trunk/libtest-base-perl/debian/changelog
trunk/libtest-base-perl/debian/control
trunk/libtest-base-perl/debian/copyright
trunk/libtest-base-perl/inc/Module/Install.pm
trunk/libtest-base-perl/inc/Module/Install/Base.pm
trunk/libtest-base-perl/inc/Module/Install/Can.pm
trunk/libtest-base-perl/inc/Module/Install/Fetch.pm
trunk/libtest-base-perl/inc/Module/Install/Makefile.pm
trunk/libtest-base-perl/inc/Module/Install/Metadata.pm
trunk/libtest-base-perl/inc/Module/Install/Win32.pm
trunk/libtest-base-perl/inc/Module/Install/WriteAll.pm
trunk/libtest-base-perl/lib/Test/Base.pm
Modified: trunk/libtest-base-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/Changes?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/Changes (original)
+++ trunk/libtest-base-perl/Changes Sun Mar 8 22:55:26 2009
@@ -1,3 +1,8 @@
+---
+version: 0.56
+date: Sat Mar 7 12:13:32 PST 2009
+changes:
+- Add Test::Deep support with is_deep and run_is_deep
---
version: 0.55
date: Thu Dec 4 01:10:11 PST 2008
Modified: trunk/libtest-base-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/MANIFEST?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/MANIFEST (original)
+++ trunk/libtest-base-perl/MANIFEST Sun Mar 8 22:55:26 2009
@@ -12,6 +12,7 @@
lib/Test/Base/Filter.pm
Makefile.PL
MANIFEST This list of files
+MANIFEST.SKIP
META.yml
README
t/append.t
@@ -26,6 +27,7 @@
t/chop.t
t/compact.t
t/compile.t
+t/deep.t
t/delimiters.t
t/description.t
t/diff_is.t
@@ -37,7 +39,9 @@
t/eval_all.t
t/eval_stderr.t
t/eval_stdout.t
+t/expected-zero.t
t/export.t
+t/exported_func.t
t/filter_arguments.t
t/filter_delay.t
t/filter_functions.t
@@ -86,6 +90,7 @@
t/run-args.t
t/run_compare.t
t/run_is.t
+t/run_is_deep.t
t/run_is_deeply.t
t/run_like.t
t/run_unlike.t
Added: trunk/libtest-base-perl/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/MANIFEST.SKIP?rev=31745&op=file
==============================================================================
--- trunk/libtest-base-perl/MANIFEST.SKIP (added)
+++ trunk/libtest-base-perl/MANIFEST.SKIP Sun Mar 8 22:55:26 2009
@@ -1,0 +1,44 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+\bSCCS\b
+,v$
+\B\.svn\b
+\B\.git\b
+\b_darcs\b
+
+# Avoid Makemaker generated and utility files.
+\bMANIFEST\.bak
+\bMakefile$
+\bblib/
+\bMakeMaker-\d
+\bpm_to_blib\.ts$
+\bpm_to_blib$
+\bblibdirs\.ts$ # 6.18 through 6.25 generated this
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build/
+
+# Avoid temp and backup files.
+~$
+\.old$
+\#$
+\b\.#
+\.bak$
+
+# Avoid Devel::Cover files.
+\bcover_db\b
+
+### DEFAULT MANIFEST.SKIP ENDS HERE ####
+
+\.DS_Store$
+\.sw.$
+(\w+-)*(\w+)-\d\.\d+(?:\.tar\.gz)?$
+
+\.t\.log$
+
+\.prove$
+
+# XS shit
+\.(?:bs|c|o)$
Modified: trunk/libtest-base-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/META.yml?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/META.yml (original)
+++ trunk/libtest-base-perl/META.yml Sun Mar 8 22:55:26 2009
@@ -3,19 +3,23 @@
author:
- 'Ingy döt Net <ingy at cpan.org>'
distribution_type: module
-generated_by: 'Module::Install version 0.75'
+generated_by: 'Module::Install version 0.79'
license: perl
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
name: Test-Base
no_index:
directory:
- inc
- t
+recommends:
+ Test::Deep: 0
requires:
Filter::Util::Call: 0
Spiffy: 0.30
Test::More: 0.62
perl: 5.6.1
-version: 0.55
+resources:
+ license: http://dev.perl.org/licenses/
+version: 0.56
Modified: trunk/libtest-base-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/Makefile.PL?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/Makefile.PL (original)
+++ trunk/libtest-base-perl/Makefile.PL Sun Mar 8 22:55:26 2009
@@ -8,6 +8,8 @@
requires Test::More => '0.62';
requires Filter::Util::Call => '0';
+recommends 'Test::Deep';
+
clean_files 't/output';
WriteAll;
Modified: trunk/libtest-base-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/README?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/README (original)
+++ trunk/libtest-base-perl/README Sun Mar 8 22:55:26 2009
@@ -166,9 +166,21 @@
NOTE: Test::Base will silently ignore any blocks that don't contain both
sections.
+ is_deep($data1, $data2, $test_name)
+ Like Test::More's "is_deeply" but uses the more correct Test::Deep
+ module.
+
+ run_is_deeply([data_name1, data_name2])
+ Like "run_is_deeply" but uses "is_deep" which uses the more correct
+ Test::Deep.
+
run_is_deeply([data_name1, data_name2])
Like "run_is" but uses "is_deeply" for complex data structure
comparison.
+
+ run_is_deeply([data_name1, data_name2])
+ Like "run_is_deeply" but uses "is_deep" which uses the more correct
+ Test::Deep.
run_like([data_name, regexp | data_name]);
The "run_like" function is similar to "run_is" except the second
@@ -620,8 +632,8 @@
Ingy döt Net <ingy at cpan.org>
COPYRIGHT
- Copyright (c) 2006, 2008. Ingy döt Net. All rights reserved. Copyright
- (c) 2005. Brian Ingerson. All rights reserved.
+ Copyright (c) 2006, 2008, 2009. Ingy döt Net. Copyright (c) 2005. Brian
+ Ingerson.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Modified: trunk/libtest-base-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/debian/changelog?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/debian/changelog (original)
+++ trunk/libtest-base-perl/debian/changelog Sun Mar 8 22:55:26 2009
@@ -1,3 +1,14 @@
+libtest-base-perl (0.56-1) unstable; urgency=low
+
+ * New upstream release.
+ + debian/copyright: Update years of copyright.
+ + Recommend libtest-deep-perl.
+ + Build-depend on libtest-deep-perl and libtest-tester-perl for additional
+ tests.
+ * Add myself to Uploaders.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Sun, 08 Mar 2009 23:51:18 +0100
+
libtest-base-perl (0.55-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libtest-base-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/debian/control?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/debian/control (original)
+++ trunk/libtest-base-perl/debian/control Sun Mar 8 22:55:26 2009
@@ -4,10 +4,11 @@
Build-Depends: debhelper (>= 7)
Build-Depends-Indep: perl (>= 5.6), libspiffy-perl (>= 0.30),
perl-modules (>= 5.8.8) | libtest-simple-perl (>= 0.62),
- libalgorithm-diff-perl, libtext-diff-perl, libyaml-perl
+ libalgorithm-diff-perl, libtext-diff-perl, libyaml-perl,
+ libtest-deep-perl, libtest-tester-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Florian Ragwitz <rafl at debian.org>, Damyan Ivanov <dmn at debian.org>,
- gregor herrmann <gregoa at debian.org>
+ gregor herrmann <gregoa at debian.org>, Ansgar Burchardt <ansgar at 43-1.org>
Standards-Version: 3.8.0
Homepage: http://search.cpan.org/dist/Test-Base/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtest-base-perl/
@@ -18,6 +19,7 @@
Depends: ${perl:Depends}, libspiffy-perl (>= 0.30), libalgorithm-diff-perl,
libtext-diff-perl, perl-modules (>= 5.8.8) | libtest-simple-perl (>= 0.6.2),
${misc:Depends}
+Recommends: libtest-deep-perl
Description: A data driven testing framework for Perl
Testing is usually the ugly part of Perl module authoring. Perl gives you a
standard way to run tests with Test::Harness, and basic testing primitives
Modified: trunk/libtest-base-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/debian/copyright?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/debian/copyright (original)
+++ trunk/libtest-base-perl/debian/copyright Sun Mar 8 22:55:26 2009
@@ -6,13 +6,13 @@
Files: *
Copyright:
- Copyright (c) 2006, 2008. Ingy döt Net. All rights reserved.
+ Copyright (c) 2006, 2008, 2009. Ingy döt Net. All rights reserved.
Copyright (c) 2005. Brian Ingerson. All rights reserved.
License-Alias: Perl
License: Artistic | GPL-1+
Files: inc/*
-Copyright: Copyright 2002 - 2008 by Brian Ingerson, Audrey Tang and Adam Kennedy
+Copyright: Copyright 2002 - 2009 by Brian Ingerson, Audrey Tang and Adam Kennedy
License-Alias: Perl
License: GPL-1+ | Artistic
Modified: trunk/libtest-base-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install.pm Sun Mar 8 22:55:26 2009
@@ -30,7 +30,7 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.75';
+ $VERSION = '0.79';
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -125,8 +125,10 @@
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')} unless uc($1) eq $1;
+ unless ( uc($1) eq $1 ) {
+ unshift @_, ( $self, $1 );
+ goto &{$self->can('call')};
+ }
};
}
@@ -248,7 +250,7 @@
sub load_extensions {
my ($self, $path, $top) = @_;
- unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+ unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
@@ -339,7 +341,10 @@
close FH or die "close($_[0]): $!";
}
-sub _version {
+# _version is for processing module versions (eg, 1.03_05) not
+# Perl versions (eg, 5.8.1).
+
+sub _version ($) {
my $s = shift || 0;
$s =~ s/^(\d+)\.?//;
my $l = $1 || 0;
@@ -348,6 +353,17 @@
return $l + 0;
}
+# Cloned from Params::Util::_CLASS
+sub _CLASS ($) {
+ (
+ defined $_[0]
+ and
+ ! ref $_[0]
+ and
+ $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s
+ ) ? $_[0] : undef;
+}
+
1;
-# Copyright 2008 Adam Kennedy.
+# Copyright 2008 - 2009 Adam Kennedy.
Modified: trunk/libtest-base-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install/Base.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install/Base.pm Sun Mar 8 22:55:26 2009
@@ -1,7 +1,7 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.75';
+$VERSION = '0.79';
# Suspend handler for "redefined" warnings
BEGIN {
@@ -45,6 +45,8 @@
$_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
}
+#line 101
+
sub is_admin {
$_[0]->admin->VERSION;
}
@@ -67,4 +69,4 @@
1;
-#line 138
+#line 146
Modified: trunk/libtest-base-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install/Can.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install/Can.pm Sun Mar 8 22:55:26 2009
@@ -11,7 +11,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.75';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -39,6 +39,7 @@
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ next if $dir eq '';
my $abs = File::Spec->catfile($dir, $_[1]);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
@@ -79,4 +80,4 @@
__END__
-#line 157
+#line 158
Modified: trunk/libtest-base-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install/Fetch.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install/Fetch.pm Sun Mar 8 22:55:26 2009
@@ -6,20 +6,20 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.75';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
sub get_file {
my ($self, %args) = @_;
- my ($scheme, $host, $path, $file) =
+ my ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
$args{url} = $args{ftp_url}
or (warn("LWP support unavailable!\n"), return);
- ($scheme, $host, $path, $file) =
+ ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
}
Modified: trunk/libtest-base-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install/Makefile.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install/Makefile.pm Sun Mar 8 22:55:26 2009
@@ -7,7 +7,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.75';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -36,9 +36,9 @@
sub makemaker_args {
my $self = shift;
- my $args = ($self->{makemaker_args} ||= {});
- %$args = ( %$args, @_ ) if @_;
- $args;
+ my $args = ( $self->{makemaker_args} ||= {} );
+ %$args = ( %$args, @_ );
+ return $args;
}
# For mm args that take multiple space-seperated args,
@@ -64,7 +64,7 @@
my $self = shift;
my $clean = $self->makemaker_args->{clean} ||= {};
%$clean = (
- %$clean,
+ %$clean,
FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
);
}
@@ -73,7 +73,7 @@
my $self = shift;
my $realclean = $self->makemaker_args->{realclean} ||= {};
%$realclean = (
- %$realclean,
+ %$realclean,
FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
);
}
@@ -116,9 +116,15 @@
# Make sure we have a new enough
require ExtUtils::MakeMaker;
- $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION );
-
- # Generate the
+
+ # MakeMaker can complain about module versions that include
+ # an underscore, even though its own version may contain one!
+ # Hence the funny regexp to get rid of it. See RT #35800
+ # for details.
+
+ $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+
+ # Generate the
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
@@ -175,7 +181,9 @@
my $user_preop = delete $args{dist}->{PREOP};
if (my $preop = $self->admin->preop($user_preop)) {
- $args{dist} = $preop;
+ foreach my $key ( keys %$preop ) {
+ $args{dist}->{$key} = $preop->{$key};
+ }
}
my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
@@ -188,7 +196,7 @@
my $top_class = ref($self->_top) || '';
my $top_version = $self->_top->VERSION || '';
- my $preamble = $self->preamble
+ my $preamble = $self->preamble
? "# Preamble by $top_class $top_version\n"
. $self->preamble
: '';
@@ -242,4 +250,4 @@
__END__
-#line 371
+#line 379
Modified: trunk/libtest-base-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install/Metadata.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install/Metadata.pm Sun Mar 8 22:55:26 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.75';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -17,9 +17,7 @@
abstract
author
version
- license
distribution_type
- perl_version
tests
installdirs
};
@@ -33,11 +31,18 @@
resources
};
-sub Meta { shift }
-sub Meta_ScalarKeys { @scalar_keys }
-sub Meta_TupleKeys { @tuple_keys }
-
-foreach my $key (@scalar_keys) {
+my @resource_keys = qw{
+ homepage
+ bugtracker
+ repository
+};
+
+sub Meta { shift }
+sub Meta_ScalarKeys { @scalar_keys }
+sub Meta_TupleKeys { @tuple_keys }
+sub Meta_ResourceKeys { @resource_keys }
+
+foreach my $key ( @scalar_keys ) {
*$key = sub {
my $self = shift;
return $self->{values}{$key} if defined wantarray and !@_;
@@ -46,12 +51,30 @@
};
}
+foreach my $key ( @resource_keys ) {
+ *$key = sub {
+ my $self = shift;
+ unless ( @_ ) {
+ return () unless $self->{values}{resources};
+ return map { $_->[1] }
+ grep { $_->[0] eq $key }
+ @{ $self->{values}{resources} };
+ }
+ return $self->{values}{resources}{$key} unless @_;
+ my $uri = shift or die(
+ "Did not provide a value to $key()"
+ );
+ $self->resources( $key => $uri );
+ return 1;
+ };
+}
+
sub requires {
my $self = shift;
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{requires} }, [ $module, $version ];
+ push @{ $self->{values}{requires} }, [ $module, $version ];
}
$self->{values}{requires};
}
@@ -61,7 +84,7 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{build_requires} }, [ $module, $version ];
+ push @{ $self->{values}{build_requires} }, [ $module, $version ];
}
$self->{values}{build_requires};
}
@@ -71,9 +94,9 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{configure_requires} }, [ $module, $version ];
- }
- $self->{values}->{configure_requires};
+ push @{ $self->{values}{configure_requires} }, [ $module, $version ];
+ }
+ $self->{values}{configure_requires};
}
sub recommends {
@@ -81,9 +104,9 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{recommends} }, [ $module, $version ];
- }
- $self->{values}->{recommends};
+ push @{ $self->{values}{recommends} }, [ $module, $version ];
+ }
+ $self->{values}{recommends};
}
sub bundles {
@@ -91,26 +114,31 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{bundles} }, [ $module, $version ];
- }
- $self->{values}->{bundles};
+ push @{ $self->{values}{bundles} }, [ $module, $version ];
+ }
+ $self->{values}{bundles};
}
# Resource handling
+my %lc_resource = map { $_ => 1 } qw{
+ homepage
+ license
+ bugtracker
+ repository
+};
+
sub resources {
my $self = shift;
while ( @_ ) {
- my $resource = shift or last;
- my $value = shift or next;
- push @{ $self->{values}->{resources} }, [ $resource, $value ];
- }
- $self->{values}->{resources};
-}
-
-sub repository {
- my $self = shift;
- $self->resources( repository => shift );
- return 1;
+ my $name = shift or last;
+ my $value = shift or next;
+ if ( $name eq lc $name and ! $lc_resource{$name} ) {
+ die("Unsupported reserved lowercase resource '$name'");
+ }
+ $self->{values}{resources} ||= [];
+ push @{ $self->{values}{resources} }, [ $name, $value ];
+ }
+ $self->{values}{resources};
}
# Aliases for build_requires that will have alternative
@@ -126,30 +154,70 @@
sub sign {
my $self = shift;
- return $self->{'values'}{'sign'} if defined wantarray and ! @_;
- $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
+ return $self->{values}{sign} if defined wantarray and ! @_;
+ $self->{values}{sign} = ( @_ ? $_[0] : 1 );
return $self;
}
sub dynamic_config {
my $self = shift;
unless ( @_ ) {
- warn "You MUST provide an explicit true/false value to dynamic_config, skipping\n";
+ warn "You MUST provide an explicit true/false value to dynamic_config\n";
return $self;
}
$self->{values}{dynamic_config} = $_[0] ? 1 : 0;
- return $self;
+ return 1;
+}
+
+sub perl_version {
+ my $self = shift;
+ return $self->{values}{perl_version} unless @_;
+ my $version = shift or die(
+ "Did not provide a value to perl_version()"
+ );
+
+ # Normalize the version
+ $version = $self->_perl_version($version);
+
+ # We don't support the reall old versions
+ unless ( $version >= 5.005 ) {
+ die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
+ }
+
+ $self->{values}{perl_version} = $version;
+}
+
+sub license {
+ my $self = shift;
+ return $self->{values}{license} unless @_;
+ my $license = shift or die(
+ 'Did not provide a value to license()'
+ );
+ $self->{values}{license} = $license;
+
+ # Automatically fill in license URLs
+ if ( $license eq 'perl' ) {
+ $self->resources( license => 'http://dev.perl.org/licenses/' );
+ }
+
+ return 1;
}
sub all_from {
my ( $self, $file ) = @_;
unless ( defined($file) ) {
- my $name = $self->name
- or die "all_from called with no args without setting name() first";
+ my $name = $self->name or die(
+ "all_from called with no args without setting name() first"
+ );
$file = join('/', 'lib', split(/-/, $name)) . '.pm';
$file =~ s{.*/}{} unless -e $file;
- die "all_from: cannot find $file from $name" unless -e $file;
+ unless ( -e $file ) {
+ die("all_from cannot find $file from $name");
+ }
+ }
+ unless ( -f $file ) {
+ die("The path '$file' does not exist, or is not a file");
}
# Some methods pull from POD instead of code.
@@ -228,8 +296,8 @@
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
- return $self->{values}->{features}
- ? @{ $self->{values}->{features} }
+ return $self->{values}{features}
+ ? @{ $self->{values}{features} }
: ();
}
@@ -303,7 +371,7 @@
$self->module_name($module_name);
}
} else {
- die "Cannot determine name from $file\n";
+ die("Cannot determine name from $file\n");
}
}
@@ -362,8 +430,12 @@
my $license_text = $1;
my @phrases = (
'under the same (?:terms|license) as perl itself' => 'perl', 1,
+ 'GNU general public license' => 'gpl', 1,
'GNU public license' => 'gpl', 1,
+ 'GNU lesser general public license' => 'lgpl', 1,
'GNU lesser public license' => 'lgpl', 1,
+ 'GNU library general public license' => 'lgpl', 1,
+ 'GNU library public license' => 'lgpl', 1,
'BSD license' => 'bsd', 1,
'Artistic license' => 'artistic', 1,
'GPL' => 'gpl', 1,
@@ -376,9 +448,6 @@
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s{\s+}{\\s+}g;
if ( $license_text =~ /\b$pattern\b/i ) {
- if ( $osi and $license_text =~ /All rights reserved/i ) {
- print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n";
- }
$self->license($license);
return 1;
}
@@ -389,19 +458,88 @@
return 'unknown';
}
-sub install_script_xxx {
- my $self = shift;
- my $args = $self->makemaker_args;
- my $exe = $args->{EXE_FILES} ||= [];
- foreach ( @_ ) {
- if ( -f $_ ) {
- push @$exe, $_;
- } elsif ( -d 'script' and -f "script/$_" ) {
- push @$exe, "script/$_";
- } else {
- die "Cannot find script '$_'";
- }
- }
+sub bugtracker_from {
+ my $self = shift;
+ my $content = Module::Install::_read($_[0]);
+ my @links = $content =~ m/L\<(http\:\/\/rt\.cpan\.org\/[^>]+)\>/g;
+ unless ( @links ) {
+ warn "Cannot determine bugtracker info from $_[0]\n";
+ return 0;
+ }
+ if ( @links > 1 ) {
+ warn "Found more than on rt.cpan.org link in $_[0]\n";
+ return 0;
+ }
+
+ # Set the bugtracker
+ bugtracker( $links[0] );
+ return 1;
+}
+
+# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
+# numbers (eg, 5.006001 or 5.008009).
+# Also, convert double-part versions (eg, 5.8)
+sub _perl_version {
+ my $v = $_[-1];
+ $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
+ $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
+ $v =~ s/(\.\d\d\d)000$/$1/;
+ $v =~ s/_.+$//;
+ if ( ref($v) ) {
+ $v = $v + 0; # Numify
+ }
+ return $v;
+}
+
+
+
+
+
+######################################################################
+# MYMETA.yml Support
+
+sub WriteMyMeta {
+ $_[0]->write_mymeta;
+}
+
+sub write_mymeta {
+ my $self = shift;
+
+ # If there's no existing META.yml there is nothing we can do
+ return unless -f 'META.yml';
+
+ # Merge the perl version into the dependencies
+ my $val = $self->Meta->{values};
+ my $perl = delete $val->{perl_version};
+ if ( $perl ) {
+ $val->{requires} ||= [];
+ my $requires = $val->{requires};
+
+ # Canonize to three-dot version after Perl 5.6
+ if ( $perl >= 5.006 ) {
+ $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
+ }
+ unshift @$requires, [ perl => $perl ];
+ }
+
+ # Load the advisory META.yml file
+ require YAML::Tiny;
+ my @yaml = YAML::Tiny::LoadFile('META.yml');
+ my $meta = $yaml[0];
+
+ # Overwrite the non-configure dependency hashs
+ delete $meta->{requires};
+ delete $meta->{build_requires};
+ delete $meta->{recommends};
+ if ( exists $val->{requires} ) {
+ $meta->{requires} = { map { @$_ } @{ $val->{requires} } };
+ }
+ if ( exists $val->{build_requires} ) {
+ $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
+ }
+
+ # Save as the MYMETA.yml file
+ YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
1;
Modified: trunk/libtest-base-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install/Win32.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install/Win32.pm Sun Mar 8 22:55:26 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.75';
+ $VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libtest-base-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/inc/Module/Install/WriteAll.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libtest-base-perl/inc/Module/Install/WriteAll.pm Sun Mar 8 22:55:26 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.75';
+ $VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libtest-base-perl/lib/Test/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/lib/Test/Base.pm?rev=31745&op=diff
==============================================================================
--- trunk/libtest-base-perl/lib/Test/Base.pm (original)
+++ trunk/libtest-base-perl/lib/Test/Base.pm Sun Mar 8 22:55:26 2009
@@ -4,7 +4,7 @@
use 5.006001;
use Spiffy 0.30 -Base;
use Spiffy ':XXX';
-our $VERSION = '0.55';
+our $VERSION = '0.56';
my @test_more_exports;
BEGIN {
@@ -28,6 +28,7 @@
delimiters spec_file spec_string
filters filters_delay filter_arguments
run run_compare run_is run_is_deeply run_like run_unlike
+ skip_all_unless_require is_deep run_is_deep
WWW XXX YYY ZZZ
tie_output no_diag_on_only
@@ -366,6 +367,34 @@
unlike($block->$x, $regexp,
$block->name ? $block->name : ()
);
+ }
+}
+
+sub skip_all_unless_require() {
+ (my ($self), @_) = find_my_self(@_);
+ my $module = shift;
+ eval "require $module; 1"
+ or Test::More::plan(
+ skip_all => "$module failed to load"
+ );
+}
+
+sub is_deep() {
+ (my ($self), @_) = find_my_self(@_);
+ require Test::Deep;
+ Test::Deep::cmp_deeply(@_);
+}
+
+sub run_is_deep() {
+ (my ($self), @_) = find_my_self(@_);
+ $self->_assert_plan;
+ my ($x, $y) = $self->_section_names(@_);
+ for my $block (@{$self->block_list}) {
+ next unless exists($block->{$x}) and exists($block->{$y});
+ $block->run_filters unless $block->is_filtered;
+ is_deep($block->$x, $block->$y,
+ $block->name ? $block->name : ()
+ );
}
}
@@ -827,9 +856,24 @@
NOTE: Test::Base will silently ignore any blocks that don't contain
both sections.
+=head2 is_deep($data1, $data2, $test_name)
+
+Like Test::More's C<is_deeply> but uses the more correct
+Test::Deep module.
+
=head2 run_is_deeply([data_name1, data_name2])
+Like C<run_is_deeply> but uses C<is_deep> which uses the more correct
+Test::Deep.
+
+=head2 run_is_deeply([data_name1, data_name2])
+
Like C<run_is> but uses C<is_deeply> for complex data structure comparison.
+
+=head2 run_is_deeply([data_name1, data_name2])
+
+Like C<run_is_deeply> but uses C<is_deep> which uses the more correct
+Test::Deep.
=head2 run_like([data_name, regexp | data_name]);
@@ -1319,7 +1363,7 @@
=head1 COPYRIGHT
-Copyright (c) 2006, 2008. Ingy döt Net.
+Copyright (c) 2006, 2008, 2009. Ingy döt Net.
Copyright (c) 2005. Brian Ingerson.
This program is free software; you can redistribute it and/or modify it
Added: trunk/libtest-base-perl/t/deep.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/t/deep.t?rev=31745&op=file
==============================================================================
--- trunk/libtest-base-perl/t/deep.t (added)
+++ trunk/libtest-base-perl/t/deep.t Sun Mar 8 22:55:26 2009
@@ -1,0 +1,27 @@
+BEGIN { eval("use Test::Tester") }
+
+use Test::Base;
+
+BEGIN {
+ skip_all_unless_require('Test::Tester');
+ skip_all_unless_require('Test::Deep');
+}
+
+plan tests => 2;
+
+my $a = {};
+my $b = bless {}, 'Foo';
+my $name = "is_deep works on non vs blessed hashes";
+my ($dummy, @results) = Test::Tester::run_tests(
+ sub {
+ is_deep($a, $b, $name);
+ },
+ {
+ ok => 0,
+ name => $name,
+ },
+);
+
+is($results[0]->{ok}, 0, "Test did not match");
+is($results[0]->{name}, $name, "Test name is correct");
+
Added: trunk/libtest-base-perl/t/expected-zero.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/t/expected-zero.t?rev=31745&op=file
==============================================================================
--- trunk/libtest-base-perl/t/expected-zero.t (added)
+++ trunk/libtest-base-perl/t/expected-zero.t Sun Mar 8 22:55:26 2009
@@ -1,0 +1,16 @@
+use Test::Base;
+plan tests => 1*blocks;
+
+run {
+ my $block = shift;
+ is 0, $block->expected;
+}
+
+__END__
+
+=== ok
+--- expected chomp
+0
+
+=== oops
+--- expected: 0
Added: trunk/libtest-base-perl/t/exported_func.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/t/exported_func.t?rev=31745&op=file
==============================================================================
--- trunk/libtest-base-perl/t/exported_func.t (added)
+++ trunk/libtest-base-perl/t/exported_func.t Sun Mar 8 22:55:26 2009
@@ -1,0 +1,21 @@
+package Testfunc;
+use Test::Base -Base;
+
+BEGIN {
+ our @EXPORT = qw(func_with_args);
+}
+
+sub func_with_args() {
+ (my ($self), @_) = find_my_self(@_);
+ return @_;
+}
+
+package main;
+BEGIN { Testfunc->import }
+
+plan tests => 1;
+
+my @ret = func_with_args(1, 2, 3);
+
+is_deeply \@ret, [ 1, 2, 3 ];
+
Added: trunk/libtest-base-perl/t/run_is_deep.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-base-perl/t/run_is_deep.t?rev=31745&op=file
==============================================================================
--- trunk/libtest-base-perl/t/run_is_deep.t (added)
+++ trunk/libtest-base-perl/t/run_is_deep.t Sun Mar 8 22:55:26 2009
@@ -1,0 +1,18 @@
+use Test::Base tests => 3;
+
+filters 'eval';
+
+run_is_deep qw(foo bar);
+
+run {
+ my $block = shift;
+ ok ref $block->foo;
+ ok ref $block->bar;
+};
+
+__DATA__
+=== Test is_deeply
+--- foo
+{ foo => 22, bar => 33 }
+--- bar
+{ bar => 33, foo => 22 }
More information about the Pkg-perl-cvs-commits
mailing list