X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2Flib%2FVariable%2FMagic%2FTestGlobalDestruction.pm;h=83f88bbfe1fb9ee726c2486385ef2a8f151e99aa;hb=164f73fb57a2d0b344236f688175649f853ec65d;hp=a840f2adf6156d34c41786c2e6d516e10a75f994;hpb=c616330372aea7cc94ba28dda6fa38fd302dbdaf;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/lib/Variable/Magic/TestGlobalDestruction.pm b/t/lib/Variable/Magic/TestGlobalDestruction.pm index a840f2a..83f88bb 100644 --- a/t/lib/Variable/Magic/TestGlobalDestruction.pm +++ b/t/lib/Variable/Magic/TestGlobalDestruction.pm @@ -68,19 +68,19 @@ sub import { if ("$]" < 5.013_004 and not $ENV{PERL_VARIABLE_MAGIC_TEST_THREADS}) { _diag("perl 5.13.4 required to safely test global destruction"); - return; + return 0; } my $env_level = int($ENV{PERL_DESTRUCT_LEVEL} || 0); if ($env_level >= $level) { my $is_debugging = is_debugging_perl(); - require Test::More; + if ($is_debugging) { _diag("Global destruction level $env_level set by PERL_DESTRUCT_LEVEL (debugging perl)"); - return; - } else { - _diag("PERL_DESTRUCT_LEVEL is set to $env_level, but this perl doesn't seem to have debugging enabled"); + return 1; } + + _diag("PERL_DESTRUCT_LEVEL is set to $env_level, but this perl doesn't seem to have debugging enabled"); } my $has_perl_destruct_level = do { @@ -91,10 +91,14 @@ sub import { 1; } }; + if ($has_perl_destruct_level) { _diag("Global destruction level $level set by Perl::Destruct::Level"); - return; + return 1; } + + _diag("Not testing global destruction"); + return 0; } 1;