X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01_basic.t;h=b93496a7d4ade0f60a6289f9ff85beb4ba9974d0;hb=82ca1dd86de69da01a9f7f746785a29f6afcaa42;hp=3c3ffbdda1c77f2e9176122c36a191278c2c3e88;hpb=5197ed544a8d8d966cdeb6e463ae13b0d2cae19c;p=p5sagit%2FDevel-GlobalDestruction.git diff --git a/t/01_basic.t b/t/01_basic.t index 3c3ffbd..b93496a 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -3,13 +3,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; + }; + } } }