]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/lib/Variable/Magic/TestGlobalDestruction.pm
Output a diagnostic if global destruction is not tested
[perl/modules/Variable-Magic.git] / t / lib / Variable / Magic / TestGlobalDestruction.pm
index ca7997fff93b96fa4831f7c6106ea52aa5efacf4..d4b67496686c5e6b9a0916a61250984b1c9762ed 100644 (file)
@@ -66,6 +66,11 @@ sub import {
  my %args  = @_;
  my $level = $args{level} || 1;
 
+ if ("$]" < 5.013_004 and not $ENV{PERL_VARIABLE_MAGIC_TEST_THREADS}) {
+  _diag("perl 5.13.4 required to safely test global destruction");
+  return;
+ }
+
  my $env_level = int($ENV{PERL_DESTRUCT_LEVEL} || 0);
  if ($env_level >= $level) {
   my $is_debugging = is_debugging_perl();
@@ -90,6 +95,9 @@ sub import {
   _diag("Global destruction level $level set by Perl::Destruct::Level");
   return;
  }
+
+ _diag("Not testing global destruction");
+ return;
 }
 
 1;