r73520 - in /trunk/libdevel-refcount-perl: Build.PL Changes LICENSE MANIFEST META.yml Makefile.PL README debian/changelog lib/Devel/Refcount.pm t/01refs.t t/02objects.t t/03fail.t t/04pp.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Apr 25 13:31:11 UTC 2011


Author: gregoa
Date: Mon Apr 25 13:31:01 2011
New Revision: 73520

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=73520
Log:
New upstream release.

Added:
    trunk/libdevel-refcount-perl/t/04pp.t
      - copied unchanged from r73519, branches/upstream/libdevel-refcount-perl/current/t/04pp.t
Modified:
    trunk/libdevel-refcount-perl/Build.PL
    trunk/libdevel-refcount-perl/Changes
    trunk/libdevel-refcount-perl/LICENSE
    trunk/libdevel-refcount-perl/MANIFEST
    trunk/libdevel-refcount-perl/META.yml
    trunk/libdevel-refcount-perl/Makefile.PL
    trunk/libdevel-refcount-perl/README
    trunk/libdevel-refcount-perl/debian/changelog
    trunk/libdevel-refcount-perl/lib/Devel/Refcount.pm
    trunk/libdevel-refcount-perl/t/01refs.t
    trunk/libdevel-refcount-perl/t/02objects.t
    trunk/libdevel-refcount-perl/t/03fail.t

Modified: trunk/libdevel-refcount-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/Build.PL?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/Build.PL (original)
+++ trunk/libdevel-refcount-perl/Build.PL Mon Apr 25 13:31:01 2011
@@ -2,27 +2,34 @@
 use warnings;
 
 use Module::Build;
+use ExtUtils::CBuilder;
 
-my $build = Module::Build->new
-  (
+my $build_xs = 1;
+
+if( $build_xs and not ExtUtils::CBuilder->new->have_compiler ) {
+   print "No C compiler is available so cannot build XS implementation\n";
+   $build_xs = 0;
+}
+
+my $build = Module::Build->new(
    module_name => 'Devel::Refcount',
    requires => {
+      'Exporter' => '5.57',
       'XSLoader' => 0,
    },
    configure_requires => {
-      'ExtUtils::CBuilder' => 0,
-      'Module::Build'      => 0,
+      'Module::Build' => 0,
    },
    build_requires => {
-      'ExtUtils::CBuilder' => 0,
-      'Module::Build'      => 0,
-      'Test::Exception'    => 0,
-      'Test::More'         => 0,
+      'Module::Build' => 0,
+      'Test::Fatal' => 0,
+      'Test::More' => 0,
    },
+   ( $build_xs ? () : ( xs_files => {} ) ),
    license => 'perl',
    create_makefile_pl => 'small',
    create_license => 1,
    create_readme  => 1,
-  );
-  
+);
+
 $build->create_build_script;

Modified: trunk/libdevel-refcount-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/Changes?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/Changes (original)
+++ trunk/libdevel-refcount-perl/Changes Mon Apr 25 13:31:01 2011
@@ -1,4 +1,12 @@
 Revision history for Devel-Refcount
+
+0.09    CHANGES:
+         * Use Test::Fatal instead of Test::Exception
+         * Provide fallback PP implementation using B
+         * Don't skip Regexp tests dependent on Perl version since all stable
+           Perl releases are fine now
+
+(0.08 skipped because I messed up the alpha version numbering of 0.08_001. Oops).
 
 0.07    CHANGES:
          * Don't use base 'Exporter'

Modified: trunk/libdevel-refcount-perl/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/LICENSE?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/LICENSE (original)
+++ trunk/libdevel-refcount-perl/LICENSE Mon Apr 25 13:31:01 2011
@@ -1,4 +1,4 @@
-This software is copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is copyright (c) 2011 by Paul Evans <leonerd at leonerd.org.uk>.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is Copyright (c) 2011 by Paul Evans <leonerd at leonerd.org.uk>.
 
 This is free software, licensed under:
 
@@ -270,7 +270,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is Copyright (c) 2011 by Paul Evans <leonerd at leonerd.org.uk>.
 
 This is free software, licensed under:
 

Modified: trunk/libdevel-refcount-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/MANIFEST?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/MANIFEST (original)
+++ trunk/libdevel-refcount-perl/MANIFEST Mon Apr 25 13:31:01 2011
@@ -11,4 +11,5 @@
 t/01refs.t
 t/02objects.t
 t/03fail.t
+t/04pp.t
 t/99pod.t

Modified: trunk/libdevel-refcount-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/META.yml?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/META.yml (original)
+++ trunk/libdevel-refcount-perl/META.yml Mon Apr 25 13:31:01 2011
@@ -5,12 +5,11 @@
 build_requires:
   ExtUtils::CBuilder: 0
   Module::Build: 0
-  Test::Exception: 0
+  Test::Fatal: 0
   Test::More: 0
 configure_requires:
-  ExtUtils::CBuilder: 0
   Module::Build: 0
-generated_by: 'Module::Build version 0.3601'
+generated_by: 'Module::Build version 0.3607'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -19,9 +18,10 @@
 provides:
   Devel::Refcount:
     file: lib/Devel/Refcount.pm
-    version: 0.07
+    version: 0.09
 requires:
+  Exporter: 5.57
   XSLoader: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.07
+version: 0.09

Modified: trunk/libdevel-refcount-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/Makefile.PL?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/Makefile.PL (original)
+++ trunk/libdevel-refcount-perl/Makefile.PL Mon Apr 25 13:31:01 2011
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.3601
+# Note: this file was auto-generated by Module::Build::Compat version 0.3607
     use Module::Build::Compat 0.02;
     
     Module::Build::Compat->run_build_pl(args => \@ARGV);

Modified: trunk/libdevel-refcount-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/README?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/README (original)
+++ trunk/libdevel-refcount-perl/README Mon Apr 25 13:31:01 2011
@@ -76,6 +76,16 @@
     SvREFCNT() of 2, because it also appears in the lexical pad for the new
     anonymous CODE block.
 
+PURE-PERL FALLBACK
+    An XS implementation of this function is provided, and is used by
+    default. If the XS library cannot be loaded, a fallback implementation
+    in pure perl using the "B" module is used instead. This will behave
+    identically, but is much slower.
+
+            Rate   pp   xs
+     pp 225985/s   -- -66%
+     xs 669570/s 196%   --
+
 SEE ALSO
     *   Test::Refcount - assert reference counts on objects
 

Modified: trunk/libdevel-refcount-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/debian/changelog?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/debian/changelog (original)
+++ trunk/libdevel-refcount-perl/debian/changelog Mon Apr 25 13:31:01 2011
@@ -1,3 +1,9 @@
+libdevel-refcount-perl (0.09-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Mon, 25 Apr 2011 15:29:29 +0200
+
 libdevel-refcount-perl (0.07-1) unstable; urgency=low
 
   [ Jonathan Yu ]

Modified: trunk/libdevel-refcount-perl/lib/Devel/Refcount.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/lib/Devel/Refcount.pm?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/lib/Devel/Refcount.pm (original)
+++ trunk/libdevel-refcount-perl/lib/Devel/Refcount.pm Mon Apr 25 13:31:01 2011
@@ -1,20 +1,23 @@
 #  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-2010 -- leonerd at leonerd.org.uk
+#  (C) Paul Evans, 2008-2011 -- leonerd at leonerd.org.uk
 
 package Devel::Refcount;
 
 use strict;
 use warnings;
 
-our $VERSION = '0.07';
+our $VERSION = '0.09';
 
 use Exporter 'import';
 our @EXPORT_OK = qw( refcount );
 
 require XSLoader;
-XSLoader::load( __PACKAGE__, $VERSION );
+if( !eval { XSLoader::load( __PACKAGE__, $VERSION ) } ) {
+   *refcount = \&_refcount_pp;
+   require B;
+}
 
 =head1 NAME
 
@@ -48,6 +51,12 @@
 Returns the reference count of the object being pointed to by $ref.
 
 =cut
+
+# This normally isn't used if the XS code is loaded
+sub _refcount_pp
+{
+   B::svref_2object( shift )->REFCNT;
+}
 
 =head1 COMPARISON WITH SvREFCNT
 
@@ -108,10 +117,16 @@
 
 =cut
 
-# Keep perl happy; keep Britain tidy
-1;
+=head1 PURE-PERL FALLBACK
 
-__END__
+An XS implementation of this function is provided, and is used by default. If
+the XS library cannot be loaded, a fallback implementation in pure perl using
+the C<B> module is used instead. This will behave identically, but is much
+slower.
+
+        Rate   pp   xs
+ pp 225985/s   -- -66%
+ xs 669570/s 196%   --
 
 =head1 SEE ALSO
 
@@ -126,3 +141,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: trunk/libdevel-refcount-perl/t/01refs.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/t/01refs.t?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/t/01refs.t (original)
+++ trunk/libdevel-refcount-perl/t/01refs.t Mon Apr 25 13:31:01 2011
@@ -24,19 +24,7 @@
 is( refcount($refs{HASH}),   1, 'refcount(HASH) is 1');
 is( refcount($refs{CODE}),   1, 'refcount(CODE) is 1');
 is( refcount($refs{GLOB}),   1, 'refcount(GLOB) is 1');
-
-SKIP: {
-   if( $] >= 5.011 ) {
-      # Perl v5.11 seems to have odd behaviour with Regexp references. They start
-      # off with a refcount of 2. Not sure if this is a bug in Perl, or my
-      # assumption. Until P5P have worked it out, we'll skip this, but just print
-      # a diagnostic
-      diag( "On Perl $], refcount(\$refs{Regexp}) is ".refcount($refs{Regexp}) );
-      skip "Bleadperl", 1;
-   }
-
-   is( refcount($refs{Regexp}), 1, 'refcount(Regexp) is 1');
-}
+is( refcount($refs{Regexp}), 1, 'refcount(Regexp) is 1');
 
 my %otherrefs = %refs;
 # Hope they're all 2 now
@@ -46,16 +34,4 @@
 is( refcount($refs{HASH}),   2, 'refcount(HASH) is now 2');
 is( refcount($refs{CODE}),   2, 'refcount(CODE) is now 2');
 is( refcount($refs{GLOB}),   2, 'refcount(GLOB) is now 2');
-
-SKIP: {
-   if( $] >= 5.011 ) {
-      # Perl v5.11 seems to have odd behaviour with Regexp references. They start
-      # off with a refcount of 2. Not sure if this is a bug in Perl, or my
-      # assumption. Until P5P have worked it out, we'll skip this, but just print
-      # a diagnostic
-      diag( "On Perl $], refcount(\$refs{Regexp}) is ".refcount($refs{Regexp}) );
-      skip "Bleadperl", 1;
-   }
-
-   is( refcount($refs{Regexp}),  2, 'refcount(Regexp) is now 2');
-}
+is( refcount($refs{Regexp}), 2, 'refcount(Regexp) is now 2');

Modified: trunk/libdevel-refcount-perl/t/02objects.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/t/02objects.t?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/t/02objects.t (original)
+++ trunk/libdevel-refcount-perl/t/02objects.t Mon Apr 25 13:31:01 2011
@@ -26,19 +26,7 @@
 is( refcount($refs{HASH}),   1, 'refcount(HASH) is 1');
 is( refcount($refs{CODE}),   1, 'refcount(CODE) is 1');
 is( refcount($refs{GLOB}),   1, 'refcount(GLOB) is 1');
-
-SKIP: {
-   if( $] >= 5.011 ) {
-      # Perl v5.11 seems to have odd behaviour with Regexp references. They start
-      # off with a refcount of 2. Not sure if this is a bug in Perl, or my
-      # assumption. Until P5P have worked it out, we'll skip this, but just print
-      # a diagnostic
-      diag( "On Perl $], refcount(\$refs{Regexp}) is ".refcount($refs{Regexp}) );
-      skip "Bleadperl", 1;
-   }
-
-   is( refcount($refs{Regexp}), 1, 'refcount(Regexp) is 1');
-}
+is( refcount($refs{Regexp}), 1, 'refcount(Regexp) is 1');
 
 my %otherrefs = %refs;
 # Hope they're all 2 now
@@ -48,16 +36,4 @@
 is( refcount($refs{HASH}),   2, 'refcount(HASH) is now 2');
 is( refcount($refs{CODE}),   2, 'refcount(CODE) is now 2');
 is( refcount($refs{GLOB}),   2, 'refcount(GLOB) is now 2');
-
-SKIP: {
-   if( $] >= 5.011 ) {
-      # Perl v5.11 seems to have odd behaviour with Regexp references. They start
-      # off with a refcount of 2. Not sure if this is a bug in Perl, or my
-      # assumption. Until P5P have worked it out, we'll skip this, but just print
-      # a diagnostic
-      diag( "On Perl $], refcount(\$refs{Regexp}) is ".refcount($refs{Regexp}) );
-      skip "Bleadperl", 1;
-   }
-
-   is( refcount($refs{Regexp}),  2, 'refcount(Regexp) is now 2');
-}
+is( refcount($refs{Regexp}), 2, 'refcount(Regexp) is now 2');

Modified: trunk/libdevel-refcount-perl/t/03fail.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-refcount-perl/t/03fail.t?rev=73520&op=diff
==============================================================================
--- trunk/libdevel-refcount-perl/t/03fail.t (original)
+++ trunk/libdevel-refcount-perl/t/03fail.t Mon Apr 25 13:31:01 2011
@@ -3,15 +3,15 @@
 use strict;
 
 use Test::More tests => 3;
-use Test::Exception;
+use Test::Fatal;
 
 use Devel::Refcount qw( refcount );
 
-dies_ok( sub { refcount() },
-         'refcount with no args fails' );
+ok( exception { refcount() },
+    'refcount with no args fails' );
 
-dies_ok( sub { refcount(undef) },
-         'refcount with undef arg fails' );
+ok( exception { refcount(undef) },
+    'refcount with undef arg fails' );
 
-dies_ok( sub { refcount("hello") },
-         'refcount with non-ref arg fails' );
+ok( exception { refcount("hello") },
+    'refcount with non-ref arg fails' );




More information about the Pkg-perl-cvs-commits mailing list