Skip Menu |

This queue is for tickets about the Devel-GlobalDestruction CPAN distribution.

Report information
The Basics
Id: 78555
Status: resolved
Priority: 0/
Queue: Devel-GlobalDestruction

People
Owner: Nobody in particular
Requestors: ilmari [...] photobox.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Missing prototype in pre-5.14 pure-perl version
Date: Tue, 24 Jul 2012 18:21:51 +0100
To: bug-Devel-GlobalDestruction [...] rt.cpan.org
From: "D. Ilmari" Mannsåker <ilmari [...] photobox.com>
Hi, As reported by lostinfog on IRC, the pure-perl version for pre-5.14 perls (without ${^GLOBAL_PHASE}) doesn't have a prototype, breaking Moo. Attached are two patches, which 1) make the pure-perl test actually test something and 2) fix the bug. -- ilmari
From 0e4dac5c9f0c0d0549be6871947ad102b251557e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@photobox.com> Date: Tue, 24 Jul 2012 18:09:19 +0100 Subject: [PATCH 1/2] Actually detect errors in pure-perl test --- Changes | 2 ++ t/01_basic.t | 5 ++++- t/10_pure-perl.t | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 7c56904..8aabdb5 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + * Actually detect errors in pure-perl test + 0.06 Thu, 14 Jun 2012 * De-retardize XS-less behavior under SpeedyCGI * Test suite now works from within space-containing paths diff --git a/t/01_basic.t b/t/01_basic.t index 5a6bdcf..6af7137 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -21,8 +21,9 @@ BEGIN { print "1..4\n"; +my $had_error = 0; sub ok ($$) { - print "not " if !$_[0]; + $had_error++, print "not " if !$_[0]; print "ok"; print " - $_[1]" if defined $_[1]; print "\n"; @@ -35,3 +36,5 @@ ok( defined &in_global_destruction, "exported" ); ok( !in_global_destruction(), "not in GD" ); our $sg = Test::Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) }); + +exit $had_error; diff --git a/t/10_pure-perl.t b/t/10_pure-perl.t index 8342391..f4b9f6e 100644 --- a/t/10_pure-perl.t +++ b/t/10_pure-perl.t @@ -16,8 +16,9 @@ my $this_file = quotemeta(__FILE__); my @tests = grep { $_ !~ /${this_file}$/ } bsd_glob("$Bin/*.t"); print "1..@{[ scalar @tests ]}\n"; +my $had_error = 0; sub ok ($$) { - print "not " if !$_[0]; + $had_error++, print "not " if !$_[0]; print "ok"; print " - $_[1]" if defined $_[1]; print "\n"; @@ -37,3 +38,4 @@ for my $fn (@tests) { ok (! $?, "Exit $? from: $^X $fn"); } +exit $had_error; -- 1.7.4.1
From db21035ea28319b808c33faaffb6615e2c021a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@photobox.com> Date: Tue, 24 Jul 2012 18:09:59 +0100 Subject: [PATCH 2/2] Add prototype to pure-perl pre-5.14 version --- Changes | 1 + lib/Devel/GlobalDestruction.pm | 2 +- t/01_basic.t | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 8aabdb5..d22d8fb 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,5 @@ * Actually detect errors in pure-perl test + * Add prototype to pure-perl pre-5.14 version 0.06 Thu, 14 Jun 2012 * De-retardize XS-less behavior under SpeedyCGI diff --git a/lib/Devel/GlobalDestruction.pm b/lib/Devel/GlobalDestruction.pm index 9030ae7..418805d 100644 --- a/lib/Devel/GlobalDestruction.pm +++ b/lib/Devel/GlobalDestruction.pm @@ -39,7 +39,7 @@ else { my ($in_global_destruction, $before_is_installed); -sub in_global_destruction { $in_global_destruction } +sub in_global_destruction () { $in_global_destruction } # This block will fire towards the end of the program execution # Since there is no way for us to generate an END which will execute *last* diff --git a/t/01_basic.t b/t/01_basic.t index 6af7137..0a53634 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -19,7 +19,7 @@ BEGIN { sub DESTROY { my $self = shift; $self->[0]->() } } -print "1..4\n"; +print "1..6\n"; my $had_error = 0; sub ok ($$) { @@ -33,6 +33,10 @@ ok( eval "use Devel::GlobalDestruction; 1", "use Devel::GlobalDestruction" ); ok( defined &in_global_destruction, "exported" ); +ok( defined prototype \&in_global_destruction, "defined prototype" ); + +ok( prototype \&in_global_destruction eq "", "empty prototype" ); + ok( !in_global_destruction(), "not in GD" ); our $sg = Test::Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) }); -- 1.7.4.1
Subject: Re: [rt.cpan.org #78555] AutoReply: Missing prototype in pre-5.14 pure-perl version
Date: Tue, 24 Jul 2012 18:25:34 +0100
To: bug-Devel-GlobalDestruction [...] rt.cpan.org
From: "D. Ilmari" Mannsåker <ilmari [...] photobox.com>
The changes can also be found on github, since I don't have commit access to p5agit: https://github.com/ilmari/devel-globaldestruction/tree/pp-prototype -- ilmari