From: Dave Rolsky Date: Thu, 22 Jan 2009 21:52:37 +0000 (+0000) Subject: try to make t/306_is_class_loaded.t skip except when it is meaningful X-Git-Tag: 0.76~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d655b6da78650bb37c086ef426d817ef429b76f;p=gitmo%2FClass-MOP.git try to make t/306_is_class_loaded.t skip except when it is meaningful --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index d4fce4c..4952d56 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -31,11 +31,11 @@ BEGIN { *check_package_cache_flag = \&mro::get_pkg_gen; } -our $VERSION = '0.75'; +our $VERSION = '0.76'; our $XS_VERSION = $VERSION; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; - + # after that everything is loaded, if we're allowed try to load faster XS # versions of various things _try_load_xs() or _load_pure_perl(); @@ -57,6 +57,8 @@ sub _try_load_xs { require Devel::GlobalDestruction; Devel::GlobalDestruction->import("in_global_destruction"); + + *USING_XS = sub () { 1 }; }; $@; }; @@ -71,7 +73,9 @@ sub _load_pure_perl { Sub::Identify->import('get_code_info'); *subname = sub { $_[1] }; - *in_global_destruction = sub () { !1 } + *in_global_destruction = sub () { !1 }; + + *USING_XS = sub () { 0 }; } diff --git a/t/306_is_class_loaded.t b/t/306_is_class_loaded.t index 3ed06c0..a4adb10 100644 --- a/t/306_is_class_loaded.t +++ b/t/306_is_class_loaded.t @@ -8,7 +8,7 @@ use Test::More; use Class::MOP (); plan 'skip_all' => 'This test is only meaningful for an XS-enabled CMOP with Perl < 5.10' - unless $Class::MOP::USING_XS && ! Class::MOP::IS_RUNNING_ON_5_10(); + unless Class::MOP::USING_XS() && ! Class::MOP::IS_RUNNING_ON_5_10(); plan tests => 1;