5 if ($ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST}) {
7 no warnings 'redefine';
9 for my $f (qw(DynaLoader::bootstrap XSLoader::load)) {
10 my ($mod) = $f =~ /^ (.+) \:\: [^:]+ $/x;
11 eval "require $mod" or die $@;
15 die 'no XS' if ($_[0]||'') eq 'Devel::GlobalDestruction';
23 package Test::Scope::Guard;
24 sub new { my ($class, $code) = @_; bless [$code], $class; }
25 sub DESTROY { my $self = shift; $self->[0]->() }
29 print "not " if !$_[0];
31 print " - $_[1]" if defined $_[1];
41 ok( $^C, "Test properly running under minus-c" );
44 use Devel::GlobalDestruction;
48 $foo = Test::Scope::Guard->new( sub {
49 ok( in_global_destruction(), "Final cleanup object destruction properly in GD" ) or do {