r47772 - in /trunk/libtest-refcount-perl: Build.PL Changes META.yml Makefile.PL README debian/changelog debian/control lib/Test/Refcount.pm t/01count.t t/02one.t t/03weak.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Thu Nov 26 03:53:59 UTC 2009
Author: jawnsy-guest
Date: Thu Nov 26 03:53:53 2009
New Revision: 47772
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47772
Log:
* Test::More has been available in core forever (no need to add
depends for perl >= 5.10 | libtest-simple-perl)
* Standards-Version 3.8.3 (no changes)
* Build using Makefile.PL (traditional) rather than Build.PL
* Bump debhelper requirement down to 7
* Suggest Devel::FindRef (no longer required upstream)
Modified:
trunk/libtest-refcount-perl/Build.PL
trunk/libtest-refcount-perl/Changes
trunk/libtest-refcount-perl/META.yml
trunk/libtest-refcount-perl/Makefile.PL
trunk/libtest-refcount-perl/README
trunk/libtest-refcount-perl/debian/changelog
trunk/libtest-refcount-perl/debian/control
trunk/libtest-refcount-perl/lib/Test/Refcount.pm
trunk/libtest-refcount-perl/t/01count.t
trunk/libtest-refcount-perl/t/02one.t
trunk/libtest-refcount-perl/t/03weak.t
Modified: trunk/libtest-refcount-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/Build.PL?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/Build.PL (original)
+++ trunk/libtest-refcount-perl/Build.PL Thu Nov 26 03:53:53 2009
@@ -7,15 +7,14 @@
(
module_name => 'Test::Refcount',
requires => {
- 'Devel::FindRef' => 0,
- 'Devel::Refcount' => 0,
- 'Scalar::Util' => 0,
- 'Test::Builder' => 0,
+ 'Devel::Refcount' => 0,
+ 'Scalar::Util' => 0,
+ 'Test::Builder' => 0,
},
build_requires => {
- 'Test::Builder::Tester' => 0,
- 'Test::More' => 0,
- },
+ 'Test::Builder::Tester' => 0,
+ 'Test::More' => 0,
+ },
license => 'perl',
create_makefile_pl => 'traditional',
create_license => 1,
Modified: trunk/libtest-refcount-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/Changes?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/Changes (original)
+++ trunk/libtest-refcount-perl/Changes Thu Nov 26 03:53:53 2009
@@ -1,4 +1,9 @@
Revision history for Test-Refcount
+
+0.06 CHANGES:
+ * Optionally use Devel::FindRef but don't depend on it being
+ installed. Removes the need to install it on smoke testers and have
+ it fail.
0.05 CHANGES:
* Added 'use warnings'
Modified: trunk/libtest-refcount-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/META.yml?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/META.yml (original)
+++ trunk/libtest-refcount-perl/META.yml Thu Nov 26 03:53:53 2009
@@ -1,25 +1,26 @@
---
name: Test-Refcount
-version: 0.05
+version: 0.06
author:
- 'Paul Evans <leonerd at leonerd.org.uk>'
abstract: assert reference counts on objects
license: perl
resources:
license: http://dev.perl.org/licenses/
+build_requires:
+ Test::Builder::Tester: 0
+ Test::More: 0
requires:
- Devel::FindRef: 0
Devel::Refcount: 0
Scalar::Util: 0
Test::Builder: 0
-build_requires:
- Test::Builder::Tester: 0
- Test::More: 0
+configure_requires:
+ Module::Build: 0.35
provides:
Test::Refcount:
file: lib/Test/Refcount.pm
- version: 0.05
-generated_by: Module::Build version 0.33
+ version: 0.06
+generated_by: Module::Build version 0.35
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Modified: trunk/libtest-refcount-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/Makefile.PL?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/Makefile.PL (original)
+++ trunk/libtest-refcount-perl/Makefile.PL Thu Nov 26 03:53:53 2009
@@ -1,11 +1,10 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.33
+# Note: this file was auto-generated by Module::Build::Compat version 0.35
use ExtUtils::MakeMaker;
WriteMakefile
(
'NAME' => 'Test::Refcount',
'VERSION_FROM' => 'lib/Test/Refcount.pm',
'PREREQ_PM' => {
- 'Devel::FindRef' => 0,
'Devel::Refcount' => 0,
'Scalar::Util' => 0,
'Test::Builder' => 0,
Modified: trunk/libtest-refcount-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/README?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/README (original)
+++ trunk/libtest-refcount-perl/README Thu Nov 26 03:53:53 2009
@@ -28,9 +28,10 @@
holds for an object class, so as to be polite to its callers.
If the assertion fails; that is, if the actual reference count is
- different to what was expected, a trace of references to the object is
- printed, using Marc Lehmann's Devel::FindRef module. See the examples
- below for more information.
+ different to what was expected, a trace of references to the object can
+ be printed, if Marc Lehmann's Devel::FindRef module is installed. This
+ may assist the developer in finding where the references are. See the
+ examples below for more information.
FUNCTIONS
is_refcount( $object, $count, $name )
@@ -46,17 +47,17 @@
use Test::More tests => 2;
use Test::Refcount;
-
- use MyBall;
-
- my $ball = MyBall->new();
+
+ use MyBall;
+
+ my $ball = MyBall->new();
is_oneref( $ball, 'One reference after construct' );
-
- $ball->bounce;
+
+ $ball->bounce;
# Any other code here that might be part of the test script
-
- is_oneref( $ball, 'One reference just before EOF' );
+
+ is_oneref( $ball, 'One reference just before EOF' );
The first assertion is just after the constructor, to check that the
reference returned by it is the only reference to that object. This fact
@@ -65,7 +66,8 @@
At this stage we expect the reference count also to be one, so that the
object is properly cleaned up.
- Suppose, when run, this produces the following output:
+ Suppose, when run, this produces the following output (presuming
+ "Devel::FindRef" is available):
1..2
ok 1 - One reference after construct
@@ -111,6 +113,18 @@
program probably wouldn't do anything quite this obvious, the trace
would still be useful in finding the likely cause of the leak.
+ If "Devel::FindRef" is unavailable, then these detailed traces will not
+ be produced. The basic reference count testing will still take place,
+ but a smaller message will be produced:
+
+ 1..2
+ ok 1 - One reference after construct
+ not ok 2 - One reference just before EOF
+ # Failed test 'One reference just before EOF'
+ # at demo.pl line 16.
+ # expected 1 references, found 2
+ # Looks like you failed 1 test of 2.
+
BUGS
* Temporaries created on the stack
Modified: trunk/libtest-refcount-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/debian/changelog?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/debian/changelog (original)
+++ trunk/libtest-refcount-perl/debian/changelog Thu Nov 26 03:53:53 2009
@@ -1,12 +1,13 @@
-libtest-refcount-perl (0.05-1) UNRELEASED; urgency=low
-
- IGNORE-VERSION: 0.05-1
- No need for upload
+libtest-refcount-perl (0.06-1) UNRELEASED; urgency=low
[ Jonathan Yu ]
* New upstream release
- + Now uses warnings
- + Added a LICENSE and README file
+ * Test::More has been available in core forever (no need to add
+ depends for perl >= 5.10 | libtest-simple-perl)
+ * Standards-Version 3.8.3 (no changes)
+ * Build using Makefile.PL (traditional) rather than Build.PL
+ * Bump debhelper requirement down to 7
+ * Suggest Devel::FindRef (no longer required upstream)
[ Nathan Handler ]
* debian/watch: Update to ignore development releases.
@@ -23,7 +24,7 @@
* debian/control: Changed: (build-)depend on perl instead of perl-
modules.
- -- Ryan Niebur <ryanryan52 at gmail.com> Tue, 01 Sep 2009 21:19:51 -0700
+ -- Jonathan Yu <jawnsy at cpan.org> Wed, 25 Nov 2009 19:32:15 -0500
libtest-refcount-perl (0.04-1) unstable; urgency=low
Modified: trunk/libtest-refcount-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/debian/control?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/debian/control (original)
+++ trunk/libtest-refcount-perl/debian/control Thu Nov 26 03:53:53 2009
@@ -1,22 +1,19 @@
Source: libtest-refcount-perl
Section: perl
Priority: optional
-Build-Depends: perl (>= 5.10) | libmodule-build-perl,
- perl (>= 5.10) | libtest-simple-perl,
- debhelper (>= 7.2.10)
-Build-Depends-Indep: libdevel-refcount-perl, libdevel-findref-perl,
- perl
+Build-Depends: debhelper (>= 7)
+Build-Depends-Indep: perl, libdevel-refcount-perl, libdevel-findref-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Jonathan Yu <jawnsy at cpan.org>
-Standards-Version: 3.8.1
+Standards-Version: 3.8.3
Homepage: http://search.cpan.org/dist/Test-Refcount/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtest-refcount-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libtest-refcount-perl/
Package: libtest-refcount-perl
Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}, libdevel-refcount-perl,
- perl (>= 5.10) | libtest-simple-perl, libdevel-findref-perl
+Depends: ${misc:Depends}, ${perl:Depends}, libdevel-refcount-perl
+Suggests: libdevel-findref-perl
Description: Perl module to assert reference counts
Test::Refcount asserts that an object's reference count is as expected. Since
Perl's automatic memory management algorithm uses reference counting to keep
Modified: trunk/libtest-refcount-perl/lib/Test/Refcount.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/lib/Test/Refcount.pm?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/lib/Test/Refcount.pm (original)
+++ trunk/libtest-refcount-perl/lib/Test/Refcount.pm Thu Nov 26 03:53:53 2009
@@ -1,7 +1,7 @@
# You may distribute under the terms of either the GNU General Public License
# or the Artistic License (the same terms as Perl itself)
#
-# (C) Paul Evans, 2008 -- leonerd at leonerd.org.uk
+# (C) Paul Evans, 2008,2009 -- leonerd at leonerd.org.uk
package Test::Refcount;
@@ -12,9 +12,8 @@
use Scalar::Util qw( weaken );
use Devel::Refcount qw( refcount );
-use Devel::FindRef;
-
-our $VERSION = '0.05';
+
+our $VERSION = '0.06';
our @EXPORT = qw(
is_refcount
@@ -53,8 +52,9 @@
for an object class, so as to be polite to its callers.
If the assertion fails; that is, if the actual reference count is different to
-what was expected, a trace of references to the object is printed, using
-Marc Lehmann's L<Devel::FindRef> module. See the examples below for more
+what was expected, a trace of references to the object can be printed, if
+Marc Lehmann's L<Devel::FindRef> module is installed. This may assist the
+developer in finding where the references are. See the examples below for more
information.
=cut
@@ -90,7 +90,10 @@
unless( $ok ) {
$tb->diag( " expected $count references, found $REFCNT" );
- $tb->diag( Devel::FindRef::track( $object ) );
+
+ if( eval { require Devel::FindRef } ) {
+ $tb->diag( Devel::FindRef::track( $object ) );
+ }
}
return $ok;
@@ -139,7 +142,8 @@
end of the file, just before the main scope closes. At this stage we expect
the reference count also to be one, so that the object is properly cleaned up.
-Suppose, when run, this produces the following output:
+Suppose, when run, this produces the following output (presuming
+C<Devel::FindRef> is available):
1..2
ok 1 - One reference after construct
@@ -184,6 +188,18 @@
probably wouldn't do anything quite this obvious, the trace would still be
useful in finding the likely cause of the leak.
+If C<Devel::FindRef> is unavailable, then these detailed traces will not be
+produced. The basic reference count testing will still take place, but a
+smaller message will be produced:
+
+ 1..2
+ ok 1 - One reference after construct
+ not ok 2 - One reference just before EOF
+ # Failed test 'One reference just before EOF'
+ # at demo.pl line 16.
+ # expected 1 references, found 2
+ # Looks like you failed 1 test of 2.
+
=head1 BUGS
=over 4
Modified: trunk/libtest-refcount-perl/t/01count.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/t/01count.t?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/t/01count.t (original)
+++ trunk/libtest-refcount-perl/t/01count.t Thu Nov 26 03:53:53 2009
@@ -5,6 +5,8 @@
use Test::Builder::Tester tests => 8;
use Test::Refcount;
+
+use constant HAVE_DEVEL_FINDREF => eval { require Devel::FindRef };
my $anon = [];
@@ -33,8 +35,8 @@
test_out( "not ok 1 - one ref" );
test_fail( +4 );
test_err( "# expected 1 references, found 2" );
-test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ );
-test_err( qr/(?:^#.*\n){1,}/m ); # Don't be sensitive on what Devel::FindRef actually prints
+test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ ) if HAVE_DEVEL_FINDREF;
+test_err( qr/(?:^#.*\n){1,}/m ) if HAVE_DEVEL_FINDREF; # Don't be sensitive on what Devel::FindRef actually prints
is_refcount( $object, 1, 'one ref' );
test_test( "two refs to object fails to be 1" );
Modified: trunk/libtest-refcount-perl/t/02one.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/t/02one.t?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/t/02one.t (original)
+++ trunk/libtest-refcount-perl/t/02one.t Thu Nov 26 03:53:53 2009
@@ -5,6 +5,8 @@
use Test::Builder::Tester tests => 3;
use Test::Refcount;
+
+use constant HAVE_DEVEL_FINDREF => eval { require Devel::FindRef };
my $anon = [];
@@ -23,7 +25,7 @@
test_out( "not ok 1 - one ref" );
test_fail( +4 );
test_err( "# expected 1 references, found 2" );
-test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ );
-test_err( qr/(?:^#.*\n){1,}/m ); # Don't be sensitive on what Devel::FindRef actually prints
+test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ ) if HAVE_DEVEL_FINDREF;
+test_err( qr/(?:^#.*\n){1,}/m ) if HAVE_DEVEL_FINDREF; # Don't be sensitive on what Devel::FindRef actually prints
is_oneref( $object, 'one ref' );
test_test( "two refs to object fails to be 1" );
Modified: trunk/libtest-refcount-perl/t/03weak.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-refcount-perl/t/03weak.t?rev=47772&op=diff
==============================================================================
--- trunk/libtest-refcount-perl/t/03weak.t (original)
+++ trunk/libtest-refcount-perl/t/03weak.t Thu Nov 26 03:53:53 2009
@@ -8,6 +8,8 @@
use Test::Refcount;
+use constant HAVE_DEVEL_FINDREF => eval { require Devel::FindRef };
+
my $object = bless {}, "Some::Class";
my $newref = $object;
@@ -15,8 +17,8 @@
test_out( "not ok 1 - one ref" );
test_fail( +4 );
test_err( "# expected 1 references, found 2" );
-test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ );
-test_err( qr/(?:^#.*\n){1,}/m ); # Don't be sensitive on what Devel::FindRef actually prints
+test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ ) if HAVE_DEVEL_FINDREF;
+test_err( qr/(?:^#.*\n){1,}/m ) if HAVE_DEVEL_FINDREF; # Don't be sensitive on what Devel::FindRef actually prints
is_oneref( $object, 'one ref' );
test_test( "two refs to object fails to be 1" );
More information about the Pkg-perl-cvs-commits
mailing list