X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02_thread.t;h=bcf487887aad218578ad76acad95f54bfb324ebb;hb=82ca1dd86de69da01a9f7f746785a29f6afcaa42;hp=90325469e946fc68208b8d30f22681023e4171a8;hpb=5197ed544a8d8d966cdeb6e463ae13b0d2cae19c;p=p5sagit%2FDevel-GlobalDestruction.git diff --git a/t/02_thread.t b/t/02_thread.t index 9032546..bcf4878 100644 --- a/t/02_thread.t +++ b/t/02_thread.t @@ -24,13 +24,19 @@ use warnings; BEGIN { if ($ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST}) { - require DynaLoader; + no strict 'refs'; no warnings 'redefine'; - my $orig = \&DynaLoader::bootstrap; - *DynaLoader::bootstrap = sub { - die 'no XS' if $_[0] eq 'Devel::GlobalDestruction'; - goto $orig; - }; + + for my $f (qw(DynaLoader::bootstrap XSLoader::load)) { + my ($mod) = $f =~ /^ (.+) \:\: [^:]+ $/x; + eval "require $mod" or die $@; + + my $orig = \&$f; + *$f = sub { + die 'no XS' if ($_[0]||'') eq 'Devel::GlobalDestruction'; + goto $orig; + }; + } } }