This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade parent from version 0.234 to 0.236
authorSteve Hay <steve.m.hay@googlemail.com>
Thu, 13 Oct 2016 07:23:55 +0000 (08:23 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Thu, 13 Oct 2016 07:23:55 +0000 (08:23 +0100)
MANIFEST
Porting/Maintainers.pl
cpan/parent/lib/parent.pm
cpan/parent/t/parent-pmc.t
cpan/parent/t/rt62341.t.disabled [new file with mode: 0644]

index 065ca84..cf274d5 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1890,6 +1890,7 @@ cpan/parent/t/parent-classfromclassfile.t tests for parent.pm
 cpan/parent/t/parent-classfromfile.t           tests for parent.pm
 cpan/parent/t/parent-pmc.t                     tests for parent.pm
 cpan/parent/t/parent-returns-false.t           tests for parent.pm
+cpan/parent/t/rt62341.t.disabled               test files for parent.pm
 cpan/Perl-OSType/lib/Perl/OSType.pm                    Perl::OSType
 cpan/Perl-OSType/t/OSType.t                    Perl::OSType
 cpan/perlfaq/lib/perlfaq.pm    Perl frequently asked questions
index 2331768..de13d72 100755 (executable)
@@ -892,8 +892,11 @@ use File::Glob qw(:case);
     },
 
     'parent' => {
-        'DISTRIBUTION' => 'CORION/parent-0.234.tar.gz',
+        'DISTRIBUTION' => 'CORION/parent-0.236.tar.gz',
         'FILES'        => q[cpan/parent],
+        'EXCLUDED'     => [
+            qr{^xt}
+        ],
     },
 
     'PathTools' => {
index f6e8cd4..e1ccef4 100644 (file)
@@ -1,7 +1,7 @@
 package parent;
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.234';
+$VERSION = '0.236';
 
 sub import {
     my $class = shift;
@@ -19,11 +19,11 @@ sub import {
 
     {
         no strict 'refs';
-        push @{"$inheritor\::ISA"}, @_;
+        push @{"$inheritor\::ISA"}, @_; # dies if a loop is detected
     };
 };
 
-"All your base are belong to us"
+1;
 
 __END__
 
index 01f70f7..68137eb 100644 (file)
@@ -14,11 +14,25 @@ use lib 't/lib';
 
 plan skip_all => ".pmc are only available with 5.6 and later" if $] < 5.006;
 
-my $no_pmc = defined &Config::non_bincompat_options
-    ? (grep $_ eq 'PERL_DISABLE_PMC', Config::non_bincompat_options())
-    : ($Config::Config{ccflags} =~ /-DPERL_DISABLE_PMC\b/);
-plan skip_all => ".pmc are disabled in this perl"
-    if $no_pmc;
+# Skip this test if perl is compiled with PERL_DISABLE_PMC
+#
+my $pmc = 1;
+if (Config->can('non_bincompat_options')) { # $] ge '5.014'
+    $pmc = 0
+        if grep { $_ eq 'PERL_DISABLE_PMC' } Config::non_bincompat_options();
+} elsif (eval {
+    require Config::Perl::V;
+    Config::Perl::V->VERSION('0.10');
+}) {
+    $pmc = 0
+        if Config::Perl::V::myconfig()->{options}{PERL_DISABLE_PMC};
+} else {
+    $pmc = 0
+        if $Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DISABLE_PMC\b/;
+}
+
+plan skip_all => 'Perl is built with PERL_DISABLE_PMC' unless $pmc;
+
 plan tests => 3;
 
 use vars qw($got_here);
diff --git a/cpan/parent/t/rt62341.t.disabled b/cpan/parent/t/rt62341.t.disabled
new file mode 100644 (file)
index 0000000..c348193
--- /dev/null
@@ -0,0 +1,101 @@
+#!perl -w\r
+use strict;\r
+use Benchmark qw/cmpthese/;\r
+use Test::More tests => 1;\r
+\r
+{\r
+    package Bench::Base;\r
+    sub foo { 1 };\r
+}\r
+\r
+my $c;\r
+my $sub_iter = 100;\r
+\r
+cmpthese (-1 => {\r
+    recompute_existing_ISA  => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}";\r
+            no strict 'refs';\r
+            @{ "$class\::ISA"} = (@{ "$class\::ISA"},'Bench::Base');\r
+            die unless $class->foo;\r
+        }\r
+    },\r
+    recompute_new_ISA  => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}::SubSub${_}";\r
+            no strict 'refs';\r
+            @{ "$class\::ISA"} = (@{ "$class\::ISA"},'Bench::Base');\r
+            die unless $class->foo;\r
+        }\r
+    },\r
+    push_existing_ISA  => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}";\r
+            no strict 'refs';\r
+            push @{ "$class\::ISA"}, 'Bench::Base';\r
+            die unless $class->foo;\r
+        }\r
+    },\r
+    push_new_ISA  => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}::SubSub${_}";\r
+            no strict 'refs';\r
+            push @{ "$class\::ISA"}, 'Bench::Base';\r
+            die unless $class->foo;\r
+        }\r
+    },\r
+    push_new_FOO  => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}::SubSub${_}";\r
+            no strict 'refs';\r
+            push @{ "$class\::FOO"}, 'Bench::Base';\r
+            #die unless $class->foo;\r
+        }\r
+    },\r
+    push_existing_FOO => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}";\r
+            no strict 'refs';\r
+            push @{ "$class\::FOO"}, 'Bench::Base';\r
+            #die unless $class->foo;\r
+        }\r
+    },\r
+    recompute_existing_FOO => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}";\r
+            no strict 'refs';\r
+            @{ "$class\::FOO"} = (@{ "$class\::FOO"}, 'Bench::Base');\r
+            #die unless $class->foo;\r
+        }\r
+    },\r
+    \r
+    # Take a reference and manipulate that, in case string references are slow\r
+    refcompute_existing_FOO => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}";\r
+            no strict 'refs';\r
+            my $aref = \@{ "$class\::FOO"};\r
+            @{ $aref } = (@{ $aref }, 'Bench::Base');\r
+            #die unless $class->foo;\r
+        }\r
+    },\r
+    recompute_new_FOO => sub {\r
+        $c++;\r
+        for (1..$sub_iter) {\r
+            my $class = "Bench::Par::Sub_${c}::SubSub${_}";\r
+            no strict 'refs';\r
+            @{ "$class\::FOO"} = (@{ "$class\::FOO"}, 'Bench::Base');\r
+            #die unless $class->foo;\r
+        }\r
+    },\r
+});\r
+\r
+pass "Benchmarks run";\r