Update to 0.34

- New upstream release 0.34
  - Support anonymous stashes on newer perl versions
  - Prevent harmful effects from invalid settings for
    $ENV{PACKAGE_STASH_IMPLEMENTATION}
  - Switch to Module::Implementation
- BR: perl(Module::Implementation) ≥ 0.06
- BR: perl(base) for test suite
- Bump Package::Stash::XS version requirement to 0.26
- Explicitly run extra tests (except on RHEL ≥ 7, where the necessary
  build dependencies may not be available)
- Update patch for building with old Test::More version in EPEL-5
This commit is contained in:
Paul Howarth 2013-01-07 11:18:15 +00:00
parent 319bda04e8
commit 83475be475
5 changed files with 534 additions and 374 deletions

2
.gitignore vendored
View File

@ -1,3 +1 @@
/Package-Stash-[0-9.]*\.tar\.gz /Package-Stash-[0-9.]*\.tar\.gz
/Package-Stash-0.32.tar.gz
/Package-Stash-0.33.tar.gz

View File

@ -1,363 +0,0 @@
diff -up Package-Stash-0.32/t/addsub.t.orig Package-Stash-0.32/t/addsub.t
--- Package-Stash-0.32/t/addsub.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/addsub.t 2011-09-06 12:32:22.277728975 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 7;
use Test::Fatal;
BEGIN { $^P |= 0x210 } # PERLDBf_SUBLINE
@@ -42,5 +42,3 @@ $foo_stash->add_symbol(
is $DB::sub{'Foo::dunk'}, sprintf "%s:%d-%d", "FileName", 100, 199,
'... got the right %DB::sub value for dunk with specified args';
-
-done_testing;
diff -up Package-Stash-0.32/t/author-leaks-debug.t.orig Package-Stash-0.32/t/author-leaks-debug.t
--- Package-Stash-0.32/t/author-leaks-debug.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/author-leaks-debug.t 2011-09-06 12:32:22.341728808 +0100
@@ -14,6 +14,8 @@ use Test::More;
use Test::Fatal;
use Test::LeakTrace;
+plan tests => 29;
+
BEGIN { $^P |= 0x210 } # PERLDBf_SUBLINE
use Package::Stash;
@@ -154,7 +156,10 @@ use Symbol;
ok($foo->has_symbol('@ISA'));
is(ref($foo->get_symbol('@ISA')), 'ARRAY');
is_deeply($foo->get_symbol('@ISA'), ['Exporter']);
+ SKIP: {
+ skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Foo', 'Exporter');
+ }
}
{
@@ -208,5 +213,3 @@ use Symbol;
eval { $foo->get_or_add_symbol('&blorg') };
} "doesn't leak on errors";
}
-
-done_testing;
diff -up Package-Stash-0.32/t/author-leaks.t.orig Package-Stash-0.32/t/author-leaks.t
--- Package-Stash-0.32/t/author-leaks.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/author-leaks.t 2011-09-06 12:32:22.294728930 +0100
@@ -14,6 +14,8 @@ use Test::More;
use Test::Fatal;
use Test::LeakTrace;
+plan tests => 29;
+
use Package::Stash;
use Symbol;
@@ -152,7 +154,10 @@ use Symbol;
ok($foo->has_symbol('@ISA'));
is(ref($foo->get_symbol('@ISA')), 'ARRAY');
is_deeply($foo->get_symbol('@ISA'), ['Exporter']);
+ SKIP: {
+ skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Foo', 'Exporter');
+ }
}
{
@@ -206,5 +211,3 @@ use Symbol;
eval { $foo->get_or_add_symbol('&blorg') };
} "doesn't leak on errors";
}
-
-done_testing;
diff -up Package-Stash-0.32/t/basic.t.orig Package-Stash-0.32/t/basic.t
--- Package-Stash-0.32/t/basic.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/basic.t 2011-09-06 12:32:53.015648488 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 129;
use Test::Fatal;
use Package::Stash;
@@ -436,5 +436,3 @@ like(
qr/^Package::Stash->new must be passed the name of the package to access/,
"module name must be a string"
);
-
-done_testing;
diff -up Package-Stash-0.32/t/compile-time.t.orig Package-Stash-0.32/t/compile-time.t
--- Package-Stash-0.32/t/compile-time.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/compile-time.t 2011-09-06 12:32:22.342728805 +0100
@@ -2,8 +2,6 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 1;
use_ok('CompileTime');
-
-done_testing;
diff -up Package-Stash-0.32/t/edge-cases.t.orig Package-Stash-0.32/t/edge-cases.t
--- Package-Stash-0.32/t/edge-cases.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/edge-cases.t 2011-09-06 12:32:22.342728805 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 11;
use Test::Fatal;
use Package::Stash;
@@ -52,5 +52,3 @@ is(ref($constant), 'CODE', "expanded a c
# was here)
is(ref($stash->get_symbol('$glob')), '', "nothing yet");
is(ref($stash->get_or_add_symbol('$glob')), 'SCALAR', "got an empty scalar");
-
-done_testing;
diff -up Package-Stash-0.32/t/extension.t.orig Package-Stash-0.32/t/extension.t
--- Package-Stash-0.32/t/extension.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/extension.t 2011-09-06 12:32:22.343728802 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 15;
use Test::Fatal;
{
@@ -72,5 +72,3 @@ is(exception {
}, undef, '... created %Foo::baz successfully');
ok(!defined($Foo::{baz}), '... the %baz slot has still not been created');
-
-done_testing;
diff -up Package-Stash-0.32/t/get.t.orig Package-Stash-0.32/t/get.t
--- Package-Stash-0.32/t/get.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/get.t 2011-09-06 12:32:22.343728802 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 36;
use Package::Stash;
use Scalar::Util;
@@ -182,5 +182,3 @@ use Scalar::Util;
"stash has the right variable");
}
}
-
-done_testing;
diff -up Package-Stash-0.32/t/impl-selection/basic-pp.t.orig Package-Stash-0.32/t/impl-selection/basic-pp.t
--- Package-Stash-0.32/t/impl-selection/basic-pp.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/impl-selection/basic-pp.t 2011-09-06 12:32:22.344728799 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 124;
use Test::Fatal;
BEGIN { $Package::Stash::IMPLEMENTATION = 'PP' }
@@ -420,5 +420,3 @@ like(exception {
"list_all_symbols CODE",
);
}
-
-done_testing;
diff -up Package-Stash-0.32/t/impl-selection/basic-xs.t.orig Package-Stash-0.32/t/impl-selection/basic-xs.t
--- Package-Stash-0.32/t/impl-selection/basic-xs.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/impl-selection/basic-xs.t 2011-09-06 12:32:22.344728799 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 124;
use Test::Fatal;
use Test::Requires 'Package::Stash::XS';
@@ -421,5 +421,3 @@ like(exception {
"list_all_symbols CODE",
);
}
-
-done_testing;
diff -up Package-Stash-0.32/t/impl-selection/choice.t.orig Package-Stash-0.32/t/impl-selection/choice.t
--- Package-Stash-0.32/t/impl-selection/choice.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/impl-selection/choice.t 2011-09-06 12:32:22.345728796 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 2;
my $has_xs = eval "require Package::Stash::XS; 1";
@@ -13,5 +13,3 @@ my $expected = $has_xs ? 'XS' : 'PP';
is($Package::Stash::IMPLEMENTATION, $expected,
"autodetected properly: $expected");
can_ok('Package::Stash', 'new');
-
-done_testing;
diff -up Package-Stash-0.32/t/impl-selection/env.t.orig Package-Stash-0.32/t/impl-selection/env.t
--- Package-Stash-0.32/t/impl-selection/env.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/impl-selection/env.t 2011-09-06 12:32:22.345728796 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 4;
# XXX: work around dumb core segfault bug when you delete stashes
sub get_impl { eval '$Package::Stash::IMPLEMENTATION' }
@@ -25,5 +25,3 @@ SKIP: {
is(get_impl, 'XS', "autodetected properly: XS");
can_ok('Package::Stash', 'new');
}
-
-done_testing;
diff -up Package-Stash-0.32/t/impl-selection/var.t.orig Package-Stash-0.32/t/impl-selection/var.t
--- Package-Stash-0.32/t/impl-selection/var.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/impl-selection/var.t 2011-09-06 12:32:22.346728793 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 4;
# XXX: work around dumb core segfault bug when you delete stashes
sub get_impl { eval '$Package::Stash::IMPLEMENTATION' }
@@ -25,5 +25,3 @@ SKIP: {
is(get_impl, 'XS', "autodetected properly: XS");
can_ok('Package::Stash', 'new');
}
-
-done_testing;
diff -up Package-Stash-0.32/t/io.t.orig Package-Stash-0.32/t/io.t
--- Package-Stash-0.32/t/io.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/io.t 2011-09-06 12:32:22.346728793 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 11;
use Test::Fatal;
{
@@ -47,5 +47,3 @@ use Package::Stash;
ok($stash->has_symbol('baz'), "has baz");
is($stash->get_symbol('baz'), *Foo::foo{IO}, "got the right baz");
}
-
-done_testing;
diff -up Package-Stash-0.32/t/isa.t.orig Package-Stash-0.32/t/isa.t
--- Package-Stash-0.32/t/isa.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/isa.t 2011-09-06 12:32:22.346728793 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 1;
use Package::Stash;
@@ -17,6 +17,7 @@ use Package::Stash;
my $stash = Package::Stash->new('Foo');
my @ISA = ('Bar');
@{$stash->get_or_add_symbol('@ISA')} = @ISA;
+SKIP: {
+skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Foo', 'Bar');
-
-done_testing;
+}
diff -up Package-Stash-0.32/t/paamayim_nekdotayim.t.orig Package-Stash-0.32/t/paamayim_nekdotayim.t
--- Package-Stash-0.32/t/paamayim_nekdotayim.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/paamayim_nekdotayim.t 2011-09-06 12:33:52.822495894 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 3;
use Test::Fatal;
use Package::Stash;
@@ -24,5 +24,3 @@ like(
qr/^Variable names may not contain ::/,
"can't add symbol with ::"
);
-
-done_testing;
diff -up Package-Stash-0.32/t/scalar-values.t.orig Package-Stash-0.32/t/scalar-values.t
--- Package-Stash-0.32/t/scalar-values.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/scalar-values.t 2011-09-06 12:32:22.347728790 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 14;
use Test::Fatal;
use B;
@@ -49,5 +49,3 @@ my $vstring = v1.2.3;
is(reftype(\$vstring), ($] < 5.010 ? 'SCALAR' : 'VSTRING'));
is(exception { $Bar->add_symbol('$vstring', \$vstring) }, undef,
"can add vstring values");
-
-done_testing;
diff -up Package-Stash-0.32/t/stash-deletion.t.orig Package-Stash-0.32/t/stash-deletion.t
--- Package-Stash-0.32/t/stash-deletion.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/stash-deletion.t 2011-09-06 12:32:22.347728790 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 2;
use Package::Stash;
@@ -20,5 +20,3 @@ use Package::Stash;
}
ok(!$delete->has_symbol('&bar'), "method goes away when stash is deleted");
}
-
-done_testing;
diff -up Package-Stash-0.32/t/synopsis.t.orig Package-Stash-0.32/t/synopsis.t
--- Package-Stash-0.32/t/synopsis.t.orig 2011-09-06 04:23:06.000000000 +0100
+++ Package-Stash-0.32/t/synopsis.t 2011-09-06 12:32:22.348728788 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 3;
use Package::Stash;
@@ -15,5 +15,3 @@ $stash->add_symbol('%foo', {bar => 1});
ok(!$stash->has_symbol('$foo'), "doesn't have anything in scalar slot");
my $namespace = $stash->namespace;
is_deeply(*{ $namespace->{foo} }{HASH}, {bar => 1}, "namespace works properly");
-
-done_testing;

View File

@ -0,0 +1,509 @@
diff -up ./t/addsub.t.orig ./t/addsub.t
--- ./t/addsub.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/addsub.t 2013-01-06 21:34:11.930954402 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 7;
use Test::Fatal;
BEGIN { $^P |= 0x210 } # PERLDBf_SUBLINE
@@ -42,5 +42,3 @@ $foo_stash->add_symbol(
is $DB::sub{'Foo::dunk'}, sprintf "%s:%d-%d", "FileName", 100, 199,
'... got the right %DB::sub value for dunk with specified args';
-
-done_testing;
diff -up ./t/anon-basic.t.orig ./t/anon-basic.t
--- ./t/anon-basic.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/anon-basic.t 2013-01-06 21:34:11.947954406 +0000
@@ -13,6 +13,8 @@ plan skip_all => "Anonymous stashes in P
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
+plan tests => 10;
+
my $Foo = Package::Anon->new('Foo');
$Foo->{SOME_CONSTANT} = \1;
@@ -399,5 +401,3 @@ $Quuux->{quuuux} = -1;
is_deeply([Package::Stash->new('Quuux')->list_all_symbols], [],
"Quuux:: isn't touched");
-
-done_testing;
diff -up ./t/anon.t.orig ./t/anon.t
--- ./t/anon.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/anon.t 2013-01-06 21:34:11.948954407 +0000
@@ -14,6 +14,8 @@ plan skip_all => "Anonymous stashes in P
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
+plan tests => 7;
+
my $anon = Package::Anon->new;
my $stash = Package::Stash->new($anon);
my $obj = $anon->bless({});
@@ -45,5 +47,3 @@ my $obj = $anon->bless({});
qr/Undefined subroutine \&__ANON__::baz called/
);
}
-
-done_testing;
diff -up ./t/bare-anon-basic.t.orig ./t/bare-anon-basic.t
--- ./t/bare-anon-basic.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/bare-anon-basic.t 2013-01-06 21:34:11.948954407 +0000
@@ -14,6 +14,8 @@ plan skip_all => "Anonymous stashes in P
plan skip_all => "This isn't really going to work yet, probably";
+plan tests => 10;
+
my $Foo = {};
$Foo->{SOME_CONSTANT} = \1;
@@ -393,5 +395,3 @@ $Quuux->{quuuux} = -1;
is_deeply([Package::Stash->new('Quuux')->list_all_symbols], [],
"Quuux:: isn't touched");
-
-done_testing;
diff -up ./t/bare-anon.t.orig ./t/bare-anon.t
--- ./t/bare-anon.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/bare-anon.t 2013-01-06 21:34:11.948954407 +0000
@@ -14,6 +14,8 @@ plan skip_all => "Anonymous stashes in P
plan skip_all => "This isn't really going to work yet, probably";
+plan tests => 10;
+
my $anon = {};
my $stash = Package::Stash->new($anon);
# no way to bless something into a hashref yet
@@ -58,5 +60,3 @@ my $stash = Package::Stash->new($anon);
undef
);
}
-
-done_testing;
diff -up ./t/basic.t.orig ./t/basic.t
--- ./t/basic.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/basic.t 2013-01-06 21:34:11.949954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 131;
use Test::Fatal;
use Package::Stash;
@@ -444,5 +444,3 @@ like(
qr/^Package::Stash->new must be passed the name of the package to access/,
"module name must be a string"
);
-
-done_testing;
diff -up ./t/compile-time.t.orig ./t/compile-time.t
--- ./t/compile-time.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/compile-time.t 2013-01-06 21:34:11.949954407 +0000
@@ -2,8 +2,6 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 1;
use_ok('CompileTime');
-
-done_testing;
diff -up ./t/edge-cases.t.orig ./t/edge-cases.t
--- ./t/edge-cases.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/edge-cases.t 2013-01-06 21:34:11.949954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 19;
use Test::Fatal;
use Package::Stash;
@@ -109,5 +109,3 @@ SKIP: {
my $stash = Package::Stash->new('HasISA');
is_deeply([$stash->list_all_symbols('SCALAR')], []);
}
-
-done_testing;
diff -up ./t/extension.t.orig ./t/extension.t
--- ./t/extension.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/extension.t 2013-01-06 21:34:11.950954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 15;
use Test::Fatal;
{
@@ -72,5 +72,3 @@ is(exception {
}, undef, '... created %Foo::baz successfully');
ok(!defined($Foo::{baz}), '... the %baz slot has still not been created');
-
-done_testing;
diff -up ./t/get.t.orig ./t/get.t
--- ./t/get.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/get.t 2013-01-06 21:34:11.950954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 36;
use Package::Stash;
use Scalar::Util;
@@ -182,5 +182,3 @@ use Scalar::Util;
"stash has the right variable");
}
}
-
-done_testing;
diff -up ./t/impl-selection/basic-pp.t.orig ./t/impl-selection/basic-pp.t
--- ./t/impl-selection/basic-pp.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/impl-selection/basic-pp.t 2013-01-06 21:34:11.950954407 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 133;
use Test::Fatal;
BEGIN { $Package::Stash::IMPLEMENTATION = 'PP' }
@@ -448,5 +448,3 @@ like(
qr/^Package::Stash->new must be passed the name of the package to access/,
"module name must be a string"
);
-
-done_testing;
diff -up ./t/impl-selection/basic-xs.t.orig ./t/impl-selection/basic-xs.t
--- ./t/impl-selection/basic-xs.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/impl-selection/basic-xs.t 2013-01-06 21:34:11.951954407 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 133;
use Test::Fatal;
use Test::Requires 'Package::Stash::XS';
@@ -449,5 +449,3 @@ like(
qr/^Package::Stash->new must be passed the name of the package to access/,
"module name must be a string"
);
-
-done_testing;
diff -up ./t/impl-selection/bug-rt-78272.t.orig ./t/impl-selection/bug-rt-78272.t
--- ./t/impl-selection/bug-rt-78272.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/impl-selection/bug-rt-78272.t 2013-01-06 21:36:22.471987526 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 2;
use Test::Fatal;
# https://rt.cpan.org/Public/Bug/Display.html?id=78272
@@ -22,18 +22,3 @@ like(
'Sanity check: forcing package reload throws the exception again'
);
-is(
- exception {
- $ENV{PACKAGE_STASH_IMPLEMENTATION} = "PP";
- delete $INC{'Package/Stash.pm'};
- require Package::Stash;
- new_ok(
- 'Package::Stash' => ['Foo'],
- 'Loaded and able to create instances'
- );
- },
- undef,
- 'Valid $ENV value loads correctly'
-);
-
-done_testing;
diff -up ./t/impl-selection/choice.t.orig ./t/impl-selection/choice.t
--- ./t/impl-selection/choice.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/impl-selection/choice.t 2013-01-06 21:34:11.951954407 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 2;
my $has_xs = eval "require Package::Stash::XS; 1";
@@ -13,5 +13,3 @@ my $expected = $has_xs ? 'XS' : 'PP';
is($Package::Stash::IMPLEMENTATION, $expected,
"autodetected properly: $expected");
can_ok('Package::Stash', 'new');
-
-done_testing;
diff -up ./t/impl-selection/env.t.orig ./t/impl-selection/env.t
--- ./t/impl-selection/env.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/impl-selection/env.t 2013-01-06 21:34:11.952954407 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 6;
# XXX: work around dumb core segfault bug when you delete stashes
sub get_impl { eval '$Package::Stash::IMPLEMENTATION' }
@@ -35,5 +35,3 @@ SKIP: {
is(get_impl, 'PP', '$ENV takes precedence over $Package::Stash::IMPLEMENTATION');
can_ok('Package::Stash', 'new');
}
-
-done_testing;
diff -up ./t/impl-selection/var.t.orig ./t/impl-selection/var.t
--- ./t/impl-selection/var.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/impl-selection/var.t 2013-01-06 21:34:11.952954407 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 4;
# XXX: work around dumb core segfault bug when you delete stashes
sub get_impl { eval '$Package::Stash::IMPLEMENTATION' }
@@ -25,5 +25,3 @@ SKIP: {
is(get_impl, 'XS', "autodetected properly: XS");
can_ok('Package::Stash', 'new');
}
-
-done_testing;
diff -up ./t/io.t.orig ./t/io.t
--- ./t/io.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/io.t 2013-01-06 21:34:11.952954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 11;
use Test::Fatal;
{
@@ -47,5 +47,3 @@ use Package::Stash;
ok($stash->has_symbol('baz'), "has baz");
is($stash->get_symbol('baz'), *Foo::foo{IO}, "got the right baz");
}
-
-done_testing;
diff -up ./t/isa.t.orig ./t/isa.t
--- ./t/isa.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/isa.t 2013-01-06 21:34:11.953954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 8;
use Package::Stash;
@@ -19,7 +19,10 @@ use Package::Stash;
my $stash = Package::Stash->new('Foo');
my @ISA = ('Bar');
@{$stash->get_or_add_symbol('@ISA')} = @ISA;
+ SKIP: {
+ skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Foo', 'Bar');
+ }
isa_ok(bless({}, 'Foo'), 'Bar');
}
@@ -33,17 +36,21 @@ use Package::Stash;
{
my $isa = $stash->get_or_add_symbol('@ISA');
@$isa = ('Baz');
+ SKIP: {
+ skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Quux', 'Baz');
+ }
isa_ok(bless({}, 'Quux'), 'Baz');
ok(Quux->can('foo'));
}
{
my $isa = $stash->get_or_add_symbol('@ISA');
@$isa = ('Bar');
+ SKIP: {
+ skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Quux', 'Bar');
+ }
isa_ok(bless({}, 'Quux'), 'Bar');
ok(Quux->can('bar'));
}
}
-
-done_testing;
diff -up ./t/magic.t.orig ./t/magic.t
--- ./t/magic.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/magic.t 2013-01-06 21:34:11.953954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 4;
use Package::Stash;
@@ -28,5 +28,3 @@ use Package::Stash;
my @foo = qw(a b c);
is(eval q["@foo"], 'a-b-c');
}
-
-done_testing;
diff -up ./t/paamayim_nekdotayim.t.orig ./t/paamayim_nekdotayim.t
--- ./t/paamayim_nekdotayim.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/paamayim_nekdotayim.t 2013-01-06 21:34:11.953954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 3;
use Test::Fatal;
use Package::Stash;
@@ -24,5 +24,3 @@ like(
qr/^Variable names may not contain ::/,
"can't add symbol with ::"
);
-
-done_testing;
diff -up ./t/scalar-values.t.orig ./t/scalar-values.t
--- ./t/scalar-values.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/scalar-values.t 2013-01-06 21:34:11.953954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 14;
use Test::Fatal;
use B;
@@ -49,5 +49,3 @@ my $vstring = v1.2.3;
is(reftype(\$vstring), ($] < 5.010 ? 'SCALAR' : 'VSTRING'));
is(exception { $Bar->add_symbol('$vstring', \$vstring) }, undef,
"can add vstring values");
-
-done_testing;
diff -up ./t/stash-deletion.t.orig ./t/stash-deletion.t
--- ./t/stash-deletion.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/stash-deletion.t 2013-01-06 21:34:11.954954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 2;
use Package::Stash;
@@ -20,5 +20,3 @@ use Package::Stash;
}
ok(!$delete->has_symbol('&bar'), "method goes away when stash is deleted");
}
-
-done_testing;
diff -up ./t/synopsis.t.orig ./t/synopsis.t
--- ./t/synopsis.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./t/synopsis.t 2013-01-06 21:34:11.954954407 +0000
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 't/lib';
-use Test::More;
+use Test::More tests => 3;
use Package::Stash;
@@ -15,5 +15,3 @@ $stash->add_symbol('%foo', {bar => 1});
ok(!$stash->has_symbol('$foo'), "doesn't have anything in scalar slot");
my $namespace = $stash->namespace;
is_deeply(*{ $namespace->{foo} }{HASH}, {bar => 1}, "namespace works properly");
-
-done_testing;
diff -up ./xt/author/leaks-debug.t.orig ./xt/author/leaks-debug.t
--- ./xt/author/leaks-debug.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./xt/author/leaks-debug.t 2013-01-06 21:34:11.954954407 +0000
@@ -6,6 +6,8 @@ use Test::More;
use Test::Fatal;
use Test::LeakTrace;
+plan tests => 45;
+
BEGIN { $^P |= 0x210 } # PERLDBf_SUBLINE
use Package::Stash;
@@ -176,7 +178,10 @@ use Symbol;
ok($foo->has_symbol('@ISA'));
is(ref($foo->get_symbol('@ISA')), 'ARRAY');
is_deeply($foo->get_symbol('@ISA'), ['Exporter']);
+ SKIP: {
+ skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Foo', 'Exporter');
+ }
}
{
@@ -226,5 +231,3 @@ use Symbol;
eval { $foo->add_symbol('&blorg') };
} "doesn't leak on errors";
}
-
-done_testing;
diff -up ./xt/author/leaks.t.orig ./xt/author/leaks.t
--- ./xt/author/leaks.t.orig 2013-01-04 09:39:44.000000000 +0000
+++ ./xt/author/leaks.t 2013-01-06 21:34:11.955954408 +0000
@@ -6,6 +6,8 @@ use Test::More;
use Test::Fatal;
use Test::LeakTrace;
+plan tests => 45;
+
use Package::Stash;
use Symbol;
@@ -174,7 +176,10 @@ use Symbol;
ok($foo->has_symbol('@ISA'));
is(ref($foo->get_symbol('@ISA')), 'ARRAY');
is_deeply($foo->get_symbol('@ISA'), ['Exporter']);
+ SKIP: {
+ skip "Test::More >= 0.88 needed for isa_ok() tests on classes", 1 if $Test::More::VERSION < 0.88;
isa_ok('Foo', 'Exporter');
+ }
}
{
@@ -224,5 +229,3 @@ use Symbol;
eval { $foo->add_symbol('&blorg') };
} "doesn't leak on errors";
}
-
-done_testing;

View File

@ -1,17 +1,20 @@
# We need to patch the test suite if we have an old version of Test::More # We need to patch the test suite if we have an old version of Test::More
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0) %global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0)
# TODO: BR: perl(Package::Anon) for test suite when available
Name: perl-Package-Stash Name: perl-Package-Stash
Version: 0.33 Version: 0.34
Release: 7%{?dist} Release: 1%{?dist}
Summary: Routines for manipulating stashes Summary: Routines for manipulating stashes
Group: Development/Libraries Group: Development/Libraries
License: GPL+ or Artistic License: GPL+ or Artistic
URL: http://search.cpan.org/dist/Package-Stash/ URL: http://search.cpan.org/dist/Package-Stash/
Source0: http://search.cpan.org/CPAN/authors/id/D/DO/DOY/Package-Stash-%{version}.tar.gz Source0: http://search.cpan.org/CPAN/authors/id/D/DO/DOY/Package-Stash-%{version}.tar.gz
Patch1: Package-Stash-0.32-old-Test::More.patch Patch1: Package-Stash-0.34-old-Test::More.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildArch: noarch BuildArch: noarch
BuildRequires: perl(base)
BuildRequires: perl(Carp) BuildRequires: perl(Carp)
BuildRequires: perl(constant) BuildRequires: perl(constant)
BuildRequires: perl(Dist::CheckConflicts) >= 0.02 BuildRequires: perl(Dist::CheckConflicts) >= 0.02
@ -19,8 +22,9 @@ BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(File::Spec) BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Temp) BuildRequires: perl(File::Temp)
BuildRequires: perl(lib) BuildRequires: perl(lib)
BuildRequires: perl(Module::Implementation) >= 0.06
BuildRequires: perl(Package::DeprecationManager) BuildRequires: perl(Package::DeprecationManager)
BuildRequires: perl(Package::Stash::XS) >= 0.24 BuildRequires: perl(Package::Stash::XS) >= 0.26
BuildRequires: perl(Scalar::Util) BuildRequires: perl(Scalar::Util)
BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::More) BuildRequires: perl(Test::More)
@ -37,7 +41,7 @@ BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(Test::Script) BuildRequires: perl(Test::Script)
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# For performance and consistency # For performance and consistency
Requires: perl(Package::Stash::XS) >= 0.24 Requires: perl(Package::Stash::XS) >= 0.26
# Not found by rpm auto-provides # Not found by rpm auto-provides
Provides: perl(Package::Stash::Conflicts) = 0 Provides: perl(Package::Stash::Conflicts) = 0
@ -65,10 +69,9 @@ find %{buildroot} -type f -name .packlist -exec rm -f {} \;
%{_fixperms} %{buildroot} %{_fixperms} %{buildroot}
%check %check
%if ! (0%{?rhel} >= 7)
make test AUTHOR_TESTING=1 RELEASE_TESTING=1
%else
make test make test
%if ! (0%{?rhel} >= 7)
make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
%endif %endif
%clean %clean
@ -82,6 +85,19 @@ rm -rf %{buildroot}
%{_mandir}/man3/Package::Stash::PP.3pm* %{_mandir}/man3/Package::Stash::PP.3pm*
%changelog %changelog
* Sun Jan 6 2013 Paul Howarth <paul@city-fan.org> - 0.34-1
- Update to 0.34
- Support anonymous stashes on newer perl versions
- Prevent harmful effects from invalid settings for
$ENV{PACKAGE_STASH_IMPLEMENTATION}
- Switch to Module::Implementation
- BR: perl(Module::Implementation) 0.06
- BR: perl(base) for test suite
- Bump Package::Stash::XS version requirement to 0.26
- Explicitly run extra tests (except on RHEL 7, where the necessary
build dependencies may not be available)
- Update patch for building with old Test::More version in EPEL-5
* Mon Aug 27 2012 Petr Pisar <ppisar@redhat.com> - 0.33-7 * Mon Aug 27 2012 Petr Pisar <ppisar@redhat.com> - 0.33-7
- Disable author tests on RHEL >= 7 - Disable author tests on RHEL >= 7

View File

@ -1 +1 @@
fe1f6efa0dbd46f8520903b436f185f1 Package-Stash-0.33.tar.gz d85874dc8abada51b8d7870d8728e3b7 Package-Stash-0.34.tar.gz