X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F03_minusc.t;h=0bb43fff10e21f160088d3bfc20a5f33f8dd8f50;hb=b1bee216b13ba067c620587ce49899927e103970;hp=09b82adabd9a16078f2a766bc28c8ab509c0b3cf;hpb=09b1281346cf3f556c319aed994f0dd305eaad63;p=p5sagit%2FDevel-GlobalDestruction.git diff --git a/t/03_minusc.t b/t/03_minusc.t index 09b82ad..0bb43ff 100644 --- a/t/03_minusc.t +++ b/t/03_minusc.t @@ -3,19 +3,9 @@ use warnings; BEGIN { if ($ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST}) { - no strict 'refs'; - no warnings 'redefine'; - - 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; - }; - } + unshift @INC, sub { + die 'no XS' if $_[1] eq 'Devel/GlobalDestruction/XS.pm'; + }; } } @@ -37,12 +27,16 @@ BEGIN { require B; B::minus_c(); - print "1..2\n"; + print "1..3\n"; ok( $^C, "Test properly running under minus-c" ); } use Devel::GlobalDestruction; +BEGIN { + ok !in_global_destruction(), "BEGIN is not GD with -c"; +} + our $foo; BEGIN { $foo = Test::Scope::Guard->new( sub {