[libvariable-magic-perl] 01/06: Imported Upstream version 0.53
Salvatore Bonaccorso
carnil at debian.org
Sun Sep 22 05:35:08 UTC 2013
This is an automated email from the git hooks/post-receive script.
carnil pushed a commit to annotated tag debian/0.53-1
in repository libvariable-magic-perl.
commit ba2ab82ec8b6bca3c25af1fbead57d6efcc6222a
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Sun Sep 22 07:16:23 2013 +0200
Imported Upstream version 0.53
---
Changes | 8 ++++
MANIFEST | 5 ---
META.json | 6 +--
META.yml | 6 +--
Makefile.PL | 2 +-
README | 14 +++----
lib/Variable/Magic.pm | 14 +++----
t/00-load.t | 2 +-
t/16-huf.t | 7 ++--
t/25-copy.t | 13 +++---
t/28-uvar.t | 8 ++--
t/30-scalar.t | 8 ++--
t/34-glob.t | 4 +-
t/91-pod.t | 16 --------
t/92-pod-coverage.t | 18 --------
t/93-pod-spelling.t | 14 -------
t/95-portability-files.t | 14 -------
t/99-kwalitee.t | 31 --------------
t/lib/VPIT/TestHelpers.pm | 77 ++++++++++++++++++++++++++++-------
t/lib/Variable/Magic/TestThreads.pm | 5 +--
20 files changed, 111 insertions(+), 161 deletions(-)
diff --git a/Changes b/Changes
index 748a344..5745f37 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,13 @@
Revision history for Variable-Magic
+0.53 2013-09-01 17:50 UTC
+ This is a maintenance release. The code contains no functional change.
+ Satisfied users of version 0.52 can skip this update.
+ + Fix : [RT #86338] : typo fix.
+ Thanks dsteinbrunner at pobox.com for the patch.
+ + Tst : Author tests are no longer bundled with this distribution.
+ They are only made available to authors in the git repository.
+
0.52 2012-11-05 02:30 UTC
+ Add : The new constant VMG_COMPAT_SCALAR_NOLEN evaluates to true
when your perl does not call 'len' magic for scalars, which
diff --git a/MANIFEST b/MANIFEST
index 9887264..8d72536 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -39,11 +39,6 @@ t/35-stash.t
t/40-threads.t
t/41-clone.t
t/80-leaks.t
-t/91-pod.t
-t/92-pod-coverage.t
-t/93-pod-spelling.t
-t/95-portability-files.t
-t/99-kwalitee.t
t/lib/VPIT/TestHelpers.pm
t/lib/Variable/Magic/TestDestroyRequired.pm
t/lib/Variable/Magic/TestGlobalDestruction.pm
diff --git a/META.json b/META.json
index 2127368..6d090d3 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
"Vincent Pit <perl at profvince.com>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921",
"license" : [
"perl_5"
],
@@ -50,7 +50,7 @@
"release_status" : "stable",
"resources" : {
"bugtracker" : {
- "web" : "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Variable-Magic"
+ "web" : "http://rt.cpan.org/Dist/Display.html?Name=Variable-Magic"
},
"homepage" : "http://search.cpan.org/dist/Variable-Magic/",
"license" : [
@@ -60,5 +60,5 @@
"url" : "http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git"
}
},
- "version" : "0.52"
+ "version" : "0.53"
}
diff --git a/META.yml b/META.yml
index c8bfd90..6ccb80e 100644
--- a/META.yml
+++ b/META.yml
@@ -14,7 +14,7 @@ configure_requires:
Config: 0
ExtUtils::MakeMaker: 0
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.120921'
+generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -31,8 +31,8 @@ requires:
base: 0
perl: 5.008
resources:
- bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Variable-Magic
+ bugtracker: http://rt.cpan.org/Dist/Display.html?Name=Variable-Magic
homepage: http://search.cpan.org/dist/Variable-Magic/
license: http://dev.perl.org/licenses/
repository: http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git
-version: 0.52
+version: 0.53
diff --git a/Makefile.PL b/Makefile.PL
index 35eea0c..97be257 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -88,7 +88,7 @@ my %META = (
},
dynamic_config => 1,
resources => {
- bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
+ bugtracker => "http://rt.cpan.org/Dist/Display.html?Name=$dist",
homepage => "http://search.cpan.org/dist/$dist/",
license => 'http://dev.perl.org/licenses/',
repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
diff --git a/README b/README
index e04ba96..b77b845 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
Variable::Magic - Associate user-defined magic to variables from Perl.
VERSION
- Version 0.52
+ Version 0.53
SYNOPSIS
use Variable::Magic qw<wizard cast VMG_OP_INFO_NAME>;
@@ -72,7 +72,7 @@ DESCRIPTION
The same magic can be applied on scalars, arrays, hashes, subs or
globs. But the same hook (see below for a list) may trigger
- differently depending on the the type of the variable.
+ differently depending on the type of the variable.
* Magic is invisible at Perl level.
@@ -560,12 +560,12 @@ DEPENDENCIES
A C compiler. This module may happen to build with a C++ compiler as
well, but don't rely on it, as no guarantee is made in this regard.
- Carp (core since perl 5), XSLoader (since 5.006).
+ Carp (core since perl 5), XSLoader (since 5.6.0).
Copy tests need Tie::Array (core since perl 5.005) and Tie::Hash (since
- 5.002). Some uvar tests need Hash::Util::FieldHash (since 5.009004).
- Glob tests need Symbol (since 5.002). Threads tests need threads and
- threads::shared (both since 5.007003).
+ 5.002). Some uvar tests need Hash::Util::FieldHash (since 5.9.4). Glob
+ tests need Symbol (since 5.002). Threads tests need threads and
+ threads::shared (both since 5.7.3).
SEE ALSO
perlguts and perlapi for internal information about magic.
@@ -593,7 +593,7 @@ SUPPORT
<http://www.profvince.com/perl/cover/Variable-Magic>.
COPYRIGHT & LICENSE
- Copyright 2007,2008,2009,2010,2011,2012 Vincent Pit, all rights
+ Copyright 2007,2008,2009,2010,2011,2012,2013 Vincent Pit, all rights
reserved.
This program is free software; you can redistribute it and/or modify it
diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm
index 7f8cedb..38d35af 100644
--- a/lib/Variable/Magic.pm
+++ b/lib/Variable/Magic.pm
@@ -11,13 +11,13 @@ Variable::Magic - Associate user-defined magic to variables from Perl.
=head1 VERSION
-Version 0.52
+Version 0.53
=cut
our $VERSION;
BEGIN {
- $VERSION = '0.52';
+ $VERSION = '0.53';
}
=head1 SYNOPSIS
@@ -88,7 +88,7 @@ You can safely apply different kinds of magics to the same variable, and each of
Magic is type-agnostic.
The same magic can be applied on scalars, arrays, hashes, subs or globs.
-But the same hook (see below for a list) may trigger differently depending on the the type of the variable.
+But the same hook (see below for a list) may trigger differently depending on the type of the variable.
=item *
@@ -671,12 +671,12 @@ L<perl> 5.8.
A C compiler.
This module may happen to build with a C++ compiler as well, but don't rely on it, as no guarantee is made in this regard.
-L<Carp> (core since perl 5), L<XSLoader> (since 5.006).
+L<Carp> (core since perl 5), L<XSLoader> (since 5.6.0).
Copy tests need L<Tie::Array> (core since perl 5.005) and L<Tie::Hash> (since 5.002).
-Some uvar tests need L<Hash::Util::FieldHash> (since 5.009004).
+Some uvar tests need L<Hash::Util::FieldHash> (since 5.9.4).
Glob tests need L<Symbol> (since 5.002).
-Threads tests need L<threads> and L<threads::shared> (both since 5.007003).
+Threads tests need L<threads> and L<threads::shared> (both since 5.7.3).
=head1 SEE ALSO
@@ -705,7 +705,7 @@ Tests code coverage report is available at L<http://www.profvince.com/perl/cover
=head1 COPYRIGHT & LICENSE
-Copyright 2007,2008,2009,2010,2011,2012 Vincent Pit, all rights reserved.
+Copyright 2007,2008,2009,2010,2011,2012,2013 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
diff --git a/t/00-load.t b/t/00-load.t
index 7bc69f4..3c62ab3 100644
--- a/t/00-load.t
+++ b/t/00-load.t
@@ -6,7 +6,7 @@ use warnings;
use Test::More tests => 1;
BEGIN {
- use_ok( 'Variable::Magic' );
+ use_ok( 'Variable::Magic' );
}
my $p = Variable::Magic::VMG_PERL_PATCHLEVEL;
diff --git a/t/16-huf.t b/t/16-huf.t
index 0f9215c..024a39c 100644
--- a/t/16-huf.t
+++ b/t/16-huf.t
@@ -5,14 +5,13 @@ use warnings;
use Test::More;
-use Variable::Magic qw<wizard cast dispell VMG_UVAR>;
-
use lib 't/lib';
use VPIT::TestHelpers;
+use Variable::Magic qw<wizard cast dispell VMG_UVAR>;
+
if (VMG_UVAR) {
- load_or_skip('Hash::Util::FieldHash', undef, [ ],
- 'required for testing uvar interaction');
+ load_or_skip_all('Hash::Util::FieldHash', undef, [ ]);
plan tests => 2 * 5 + 7 + 1;
} else {
skip_all 'No nice uvar magic for this perl';
diff --git a/t/25-copy.t b/t/25-copy.t
index 04ed1c9..3944495 100644
--- a/t/25-copy.t
+++ b/t/25-copy.t
@@ -5,6 +5,9 @@ use warnings;
use Test::More;
+use lib 't/lib';
+use VPIT::TestHelpers;
+
use Variable::Magic qw<cast dispell>;
plan tests => 2 + ((2 * 5 + 3) + (2 * 2 + 1)) + (2 * 9 + 6) + 1;
@@ -16,10 +19,7 @@ use Variable::Magic::TestValue;
my $wiz = init_watcher 'copy', 'copy';
SKIP: {
- my $has_tie_array = do { local $@; eval { require Tie::Array; 1 } };
- skip 'Tie::Array required to test copy magic on arrays'
- => (2 * 5 + 3) + (2 * 2 + 1) unless $has_tie_array;
- defined and diag "Using Tie::Array $_" for $Tie::Array::VERSION;
+ load_or_skip('Tie::Array', undef, undef, (2 * 5 + 3) + (2 * 2 + 1));
tie my @a, 'Tie::StdArray';
@a = (1 .. 10);
@@ -51,10 +51,7 @@ SKIP: {
}
SKIP: {
- my $has_tie_hash = do { local $@; eval { require Tie::Hash; 1 } };
- skip 'Tie::Hash required to test copy magic on hashes'
- => 2 * 9 + 6 unless $has_tie_hash;
- defined and diag "Using Tie::Hash $_" for $Tie::Hash::VERSION;
+ load_or_skip('Tie::Hash', undef, undef, 2 * 9 + 6);
tie my %h, 'Tie::StdHash';
%h = (a => 1, b => 2, c => 3);
diff --git a/t/28-uvar.t b/t/28-uvar.t
index d44f9f1..4c6d902 100644
--- a/t/28-uvar.t
+++ b/t/28-uvar.t
@@ -5,6 +5,9 @@ use warnings;
use Test::More;
+use lib 't/lib';
+use VPIT::TestHelpers;
+
use Variable::Magic qw<wizard cast dispell VMG_UVAR>;
if (VMG_UVAR) {
@@ -51,10 +54,7 @@ $x = watch { $h{a} } { fetch => 1 }, 'fetch directly with also non uvar magic';
is $x, 1, 'uvar: fetch directly with also non uvar magic correctly';
SKIP: {
- my $has_tie_hash = do { local $@; eval { require Tie::Hash; 1 } };
- skip 'Tie::Hash required to test uvar magic on tied hashes'
- => 2 * 5 + 4 unless $has_tie_hash;
- defined and diag "Using Tie::Hash $_" for $Tie::Hash::VERSION;
+ load_or_skip('Tie::Hash', undef, undef, 2 * 5 + 4);
tie my %h, 'Tie::StdHash';
%h = (x => 7, y => 8);
diff --git a/t/30-scalar.t b/t/30-scalar.t
index 4189ee5..59ab5e5 100644
--- a/t/30-scalar.t
+++ b/t/30-scalar.t
@@ -7,6 +7,9 @@ use Config qw<%Config>;
use Test::More tests => (2 * 14 + 2) + 2 * (2 * 8 + 4) + 5 + 1;
+use lib 't/lib';
+use VPIT::TestHelpers;
+
use Variable::Magic qw<wizard cast dispell>;
use lib 't/lib';
@@ -103,10 +106,7 @@ is $b, 6, 'scalar: hash element: delete correctly';
watch { $h{b} = 4 } { }, 'hash element: set after delete';
SKIP: {
- unless (do { local $@; eval { require Tie::Array; 1 } }) {
- skip 'Tie::Array required to test clear magic on tied array values' => 5;
- }
- defined and diag "Using Tie::Array $_" for $Tie::Array::VERSION;
+ load_or_skip('Tie::Array', undef, undef, 5);
tie my @a, 'Tie::StdArray';
$a[0] = $$;
diff --git a/t/34-glob.t b/t/34-glob.t
index 2e1a441..af77a4f 100644
--- a/t/34-glob.t
+++ b/t/34-glob.t
@@ -9,9 +9,7 @@ use lib 't/lib';
use VPIT::TestHelpers;
BEGIN {
- load_or_skip('Symbol', undef, [ 'gensym' ],
- 'required for testing magic for globs');
-
+ load_or_skip_all('Symbol', undef, [ 'gensym' ]);
plan tests => 2 * 17 + 1;
}
diff --git a/t/91-pod.t b/t/91-pod.t
deleted file mode 100644
index c2d16af..0000000
--- a/t/91-pod.t
+++ /dev/null
@@ -1,16 +0,0 @@
-#!perl -T
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use lib 't/lib';
-use VPIT::TestHelpers;
-
-load_or_skip('Test::Pod', '1.22', [ ],
- 'required for testing POD syntax');
-
-eval 'use Test::Pod'; # Make Kwalitee test happy
-
-all_pod_files_ok();
diff --git a/t/92-pod-coverage.t b/t/92-pod-coverage.t
deleted file mode 100644
index 6399021..0000000
--- a/t/92-pod-coverage.t
+++ /dev/null
@@ -1,18 +0,0 @@
-#!perl -T
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use lib 't/lib';
-use VPIT::TestHelpers;
-
-my $desc = 'required for testing POD coverage';
-
-load_or_skip('Test::Pod::Coverage', '1.08', [ ], $desc);
-load_or_skip('Pod::Coverage', '0.18', undef, $desc);
-
-eval 'use Test::Pod::Coverage'; # Make Kwalitee test happy
-
-all_pod_coverage_ok( { also_private => [ qr/^_/, qr/^CLONE(_SKIP)?$/ ] } );
diff --git a/t/93-pod-spelling.t b/t/93-pod-spelling.t
deleted file mode 100644
index 1636764..0000000
--- a/t/93-pod-spelling.t
+++ /dev/null
@@ -1,14 +0,0 @@
-#!perl
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use lib 't/lib';
-use VPIT::TestHelpers;
-
-load_or_skip('Test::Pod::Spelling::CommonMistakes', '1.0', [ ],
- 'required for testing POD spelling');
-
-all_pod_files_ok();
diff --git a/t/95-portability-files.t b/t/95-portability-files.t
deleted file mode 100644
index 55a9005..0000000
--- a/t/95-portability-files.t
+++ /dev/null
@@ -1,14 +0,0 @@
-#!perl -T
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use lib 't/lib';
-use VPIT::TestHelpers;
-
-load_or_skip('Test::Portability::Files', undef, [ ],
- 'required for testing filenames portability');
-
-run_tests();
diff --git a/t/99-kwalitee.t b/t/99-kwalitee.t
deleted file mode 100644
index 796fe61..0000000
--- a/t/99-kwalitee.t
+++ /dev/null
@@ -1,31 +0,0 @@
-#!perl
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use lib 't/lib';
-use VPIT::TestHelpers;
-
-my $guard = VPIT::TestHelpers::Guard->new(
- sub { unlink for glob 'Debian_CPANTS.txt*' }
-);
-
-my $desc = 'required to test kwalitee';
-
-load_or_skip('Parse::RecDescent', '1.967006', undef, $desc);
-load_or_skip('Module::ExtractUse', '0.24', undef, $desc);
-load_or_skip('Test::Kwalitee', '1.01', undef, $desc);
-
-SKIP: {
- eval { Test::Kwalitee->import(); };
- if (my $err = $@) {
- 1 while chomp $err;
- require Test::Builder;
- my $Test = Test::Builder->new;
- my $plan = $Test->has_plan;
- $Test->skip_all($err) if not defined $plan or $plan eq 'no_plan';
- skip $err => $plan - $Test->current_test;
- }
-}
diff --git a/t/lib/VPIT/TestHelpers.pm b/t/lib/VPIT/TestHelpers.pm
index 18f2b17..3d545e8 100644
--- a/t/lib/VPIT/TestHelpers.pm
+++ b/t/lib/VPIT/TestHelpers.pm
@@ -4,42 +4,61 @@ use strict;
use warnings;
my %exports = (
- load_or_skip => \&load_or_skip,
- skip_all => \&skip_all,
+ load_or_skip => \&load_or_skip,
+ load_or_skip_all => \&load_or_skip_all,
+ skip_all => \&skip_all,
);
sub import {
my $pkg = caller;
+
while (my ($name, $code) = each %exports) {
no strict 'refs';
*{$pkg.'::'.$name} = $code;
}
}
-sub skip_all {
- my ($msg) = @_;
- require Test::More;
- Test::More::plan(skip_all => $msg);
-}
+my $test_sub = sub {
+ my $sub = shift;
+
+ my $stash;
+ if ($INC{'Test/Leaner.pm'}) {
+ $stash = \%Test::Leaner::;
+ } else {
+ require Test::More;
+ $stash = \%Test::More::;
+ }
+
+ my $glob = $stash->{$sub};
+ return $glob ? *$glob{CODE} : undef;
+};
+
+sub skip { $test_sub->('skip')->(@_) }
+
+sub skip_all { $test_sub->('plan')->(skip_all => $_[0]) }
sub diag {
- require Test::More;
- Test::More::diag($_) for @_;
+ my $diag = $test_sub->('diag');
+ $diag->($_) for @_;
}
our $TODO;
local $TODO;
-sub load_or_skip {
- my ($pkg, $ver, $imports, $desc) = @_;
+sub load {
+ my ($pkg, $ver, $imports) = @_;
+
my $spec = $ver && $ver !~ /^[0._]*$/ ? "$pkg $ver" : $pkg;
+ my $err;
+
local $@;
if (eval "use $spec (); 1") {
$ver = do { no strict 'refs'; ${"${pkg}::VERSION"} };
$ver = 'undef' unless defined $ver;
+
if ($imports) {
my @imports = @$imports;
- my $caller = (caller 0)[0];
+ my $caller = (caller 1)[0];
local $@;
my $res = eval <<"IMPORTER";
package
@@ -47,12 +66,40 @@ package
BEGIN { \$pkg->import(\@imports) }
1;
IMPORTER
- skip_all "Could not import '@imports' from $pkg $ver: $@" unless $res;
+ $err = "Could not import '@imports' from $pkg $ver: $@" unless $res;
}
- diag "Using $pkg $ver";
} else {
- skip_all "$spec $desc";
+ (my $file = "$pkg.pm") =~ s{::}{/}g;
+ delete $INC{$file};
+ $err = "Could not load $spec";
}
+
+ if ($err) {
+ return wantarray ? (0, $err) : 0;
+ } else {
+ diag "Using $pkg $ver";
+ return 1;
+ }
+}
+
+sub load_or_skip {
+ my ($pkg, $ver, $imports, $tests) = @_;
+
+ die 'You must specify how many tests to skip' unless defined $tests;
+
+ my ($loaded, $err) = load($pkg, $ver, $imports);
+ skip $err => $tests unless $loaded;
+
+ return $loaded;
+}
+
+sub load_or_skip_all {
+ my ($pkg, $ver, $imports) = @_;
+
+ my ($loaded, $err) = load($pkg, $ver, $imports);
+ skip_all $err unless $loaded;
+
+ return $loaded;
}
package VPIT::TestHelpers::Guard;
diff --git a/t/lib/Variable/Magic/TestThreads.pm b/t/lib/Variable/Magic/TestThreads.pm
index a11bae7..e67ea3f 100644
--- a/t/lib/Variable/Magic/TestThreads.pm
+++ b/t/lib/Variable/Magic/TestThreads.pm
@@ -25,9 +25,8 @@ sub import {
skip_all 'perl 5.13.4 required to test thread safety'
unless $force or "$]" >= 5.013_004;
- my $desc = 'required to test thread safety';
- load_or_skip('threads', $force ? '0' : '1.67', [ ], $desc);
- load_or_skip('threads::shared', $force ? '0' : '1.14', [ ], $desc);
+ load_or_skip_all('threads', $force ? '0' : '1.67', [ ]);
+ load_or_skip_all('threads::shared', $force ? '0' : '1.14', [ ]);
my %exports = (
spawn => \&spawn,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libvariable-magic-perl.git
More information about the Pkg-perl-cvs-commits
mailing list