Subject: | Devel::Peek::SvREFCNT will gain a prototype with perl 5.20 |
Hi,
As of perl 5.20, Devel::Peek::SvREFCNT will have a prototype that allows it to be
used with non-scalar arguments.
Unfortunately the Escape-Houdini t/gc.t test file loads Devel::Peek in such a way that the prototype isn't available at compile time, and so the call to SvREFCNT() misbehaves.
The attached patch fixes this problem and retains backward compatibility with older releases of perl, though you may want to use a different approach.
Tony
#
# Generated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10
# perl: 5.019009 (wanted any version) on linux from /home/tony/perl/blead/bin/perl5.19.9
#
# DynaLoader => 1.24_1 (want any version)
# Exporter => 5.70 (want any version)
# File::Spec => 3.46 (want any version)
# IO::Handle => 1.35 (want any version)
# IPC::Open3 => 1.16 (want any version)
# Module::Build => 0.4204 (want 0.3601)
# Test::Exception => 0.32 (want any version)
# Test::More => 1.001002 (want 0.88)
# parent => 0.228 (want any version)
# strict => 1.08 (want any version)
# warnings => 1.22 (want any version)
#
# Thanks for using my code. I hope it works for you.
# If not, please try and include this output in the bug report.
# That will help me reproduce the issue and solve your problem.
#
t/000-report-versions-tiny.t .. ok
t/basic.t ..................... ok
t/gc.t ........................ Usage: Devel::Peek::SvREFCNT(SCALAR) at t/gc.t line 12.
# Child (refcount) exited without calling finalize()
t/gc.t ........................ 1/2
# Failed test 'refcount'
# at /home/tony/perl/blead/lib/5.19.9/Test/Builder.pm line 276.
# Looks like you planned 2 tests but ran 1.
# Looks like you failed 1 test of 1 run.
# Looks like your test exited with 2 just after 1.
t/gc.t ........................ Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests
t/growth.t .................... skipped: Test::MemoryGrowth required for tests
t/samples.t ................... ok
Test Summary Report
-------------------
t/gc.t (Wstat: 512 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 2
Parse errors: Bad plan. You planned 2 tests but ran 1.
Files=6, Tests=21, 1 wallclock secs ( 0.02 usr 0.03 sys + 0.28 cusr 0.07 csys = 0.40 CPU)
Result: FAIL
Subject: | 0001-Devel-Peek-SvREFCNT-has-a-prototype-with-5.20-ensure.patch |
From 3e707c052be6dc2f9dcdb88fed3759417bf9da58 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 30 Jan 2014 14:43:01 +1100
Subject: [PATCH] Devel::Peek::SvREFCNT has a prototype with 5.20, ensure it's
available
---
t/gc.t | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/gc.t b/t/gc.t
index 7f93c8a..c0c1970 100644
--- a/t/gc.t
+++ b/t/gc.t
@@ -3,8 +3,11 @@ use warnings;
use Test::More tests => 2;
use Escape::Houdini qw(escape_html);
+my $can_dump;
+
subtest 'refcount' => sub {
- eval 'use Devel::Peek qw(SvREFCNT Dump); 1'
+ BEGIN { $can_dump = eval 'use Devel::Peek qw(SvREFCNT Dump); 1' }
+ $can_dump
or plan skip_all => 'test requires Devel::Peek';
plan tests => 1;
--
1.7.10.4