From: Peter Rabbitson Date: Mon, 12 Nov 2012 10:18:32 +0000 (+0100) Subject: Pass tests with CXSA but without SN X-Git-Tag: v0.10008~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a1ba8bdc62a701ef7b8ec39191ba526e067071f;p=p5sagit%2FClass-Accessor-Grouped.git Pass tests with CXSA but without SN --- diff --git a/Changes b/Changes index e6edd25..3068caf 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Class::Accessor::Grouped. + - Pass tests if Class::XSAccessor is available but Sub::Name isn't + 0.10007 2012-11-08 11:54 (UTC) - Disable tests on perls where Class::XSAccessor emits broken error messages (RT#74883, RT#80519) diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index afe019b..d504c3f 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -45,11 +45,11 @@ BEGIN { } ? 0 : "$@" ); my $found_cxsa; - constant->import( NO_CXSA => ( !NO_SUBNAME() and eval { + constant->import( NO_CXSA => ( NO_SUBNAME() || ( eval { Module::Runtime::require_module('Class::XSAccessor'); $found_cxsa = Class::XSAccessor->VERSION; Class::XSAccessor->VERSION($__minimum_xsa_version); - } ) ? 0 : "$@" ); + } ? 0 : "$@" ) ) ); if (NO_CXSA() and $found_cxsa and !$ENV{CAG_OLD_XS_NOWARN}) { warn( diff --git a/t/accessors_xs.t b/t/accessors_xs.t index c5e0984..ccefd72 100644 --- a/t/accessors_xs.t +++ b/t/accessors_xs.t @@ -7,7 +7,11 @@ use Test::More; use lib 't/lib'; BEGIN { + plan skip_all => "Sub::Name not available" + unless eval { require Sub::Name }; + require Class::Accessor::Grouped; + my $xsa_ver = $Class::Accessor::Grouped::__minimum_xsa_version; eval { require Class::XSAccessor; diff --git a/t/accessors_xs_cachedwarn.t b/t/accessors_xs_cachedwarn.t index 3e3ee1c..42f0ebf 100644 --- a/t/accessors_xs_cachedwarn.t +++ b/t/accessors_xs_cachedwarn.t @@ -4,7 +4,11 @@ use Test::More; use lib 't/lib'; BEGIN { + plan skip_all => "Sub::Name not available" + unless eval { require Sub::Name }; + require Class::Accessor::Grouped; + my $xsa_ver = $Class::Accessor::Grouped::__minimum_xsa_version; eval { require Class::XSAccessor;