X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-GlobalDestruction.git;a=blobdiff_plain;f=t%2F06_load-in-gd.t;h=4140aa4a746112b37c32e30430eb5f7dfcd8f33f;hp=f51c4015d3165a2cbddb81557e886efe5c66f82d;hb=9d52b29fa83c510e24ea07ff4def5c81c420ea4a;hpb=350bef653f634d1c7cb7357b45e1835b1489f9b7 diff --git a/t/06_load-in-gd.t b/t/06_load-in-gd.t index f51c401..4140aa4 100644 --- a/t/06_load-in-gd.t +++ b/t/06_load-in-gd.t @@ -15,12 +15,22 @@ BEGIN { sub DESTROY { my $self = shift; $self->[0]->() } } -print "1..1\n"; +use POSIX qw(_exit); + +# doesn't always work when loaded in gd, so pre-load it +use Sub::Exporter::Progressive (); + +$|++; +print "1..3\n"; our $alive = Test::Scope::Guard->new(sub { require Devel::GlobalDestruction; my $gd = Devel::GlobalDestruction::in_global_destruction(); - print(($gd ? '' : 'not ') . "ok 1 - global destruct detected when loaded during GD\n"); - exit($gd ? 0 : 1); + print(($gd ? '' : 'not ') . "ok 3 - global destruct detected when loaded during GD\n"); + _exit($gd ? 0 : 1); }); +print(($alive ? '' : 'not ') . "ok 1 - alive during runtime\n"); +END { + print(($alive ? '' : 'not ') . "ok 2 - alive during END\n"); +}