5 if ($ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST}) {
7 die 'no XS' if $_[1] eq 'Devel/GlobalDestruction/XS.pm';
13 package Test::Scope::Guard;
14 sub new { my ($class, $code) = @_; bless [$code], $class; }
15 sub DESTROY { my $self = shift; $self->[0]->() }
19 print "not " if !$_[0];
21 print " - $_[1]" if defined $_[1];
31 ok( $^C, "Test properly running under minus-c" );
34 use Devel::GlobalDestruction;
37 ok !in_global_destruction(), "BEGIN is not GD with -c";
42 $foo = Test::Scope::Guard->new( sub {
43 ok( in_global_destruction(), "Final cleanup object destruction properly in GD" ) or do {