From: Graham Knop Date: Thu, 24 Oct 2013 09:58:46 +0000 (-0400) Subject: Sub::Exporter::Progressive may break when loaded in GD so preload it in test X-Git-Tag: Devel-GlobalDestruction-0.12~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d52b29fa83c510e24ea07ff4def5c81c420ea4a;p=p5sagit%2FDevel-GlobalDestruction.git Sub::Exporter::Progressive may break when loaded in GD so preload it in test --- 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"); +}