use warnings;
BEGIN {
+ package DBIx::Class::_ENV_;
+
if ($] < 5.009_005) {
require MRO::Compat;
- *DBIx::Class::_ENV_::OLD_MRO = sub () { 1 };
+ *OLD_MRO = sub () { 1 };
}
else {
require mro;
- *DBIx::Class::_ENV_::OLD_MRO = sub () { 0 };
+ *OLD_MRO = sub () { 0 };
}
# ::Runmode would only be loaded by DBICTest, which in turn implies t/
- *DBIx::Class::_ENV_::DBICTEST = eval { DBICTest::RunMode->is_author }
+ *DBICTEST = eval { DBICTest::RunMode->is_author }
? sub () { 1 }
: sub () { 0 }
;
+
+ # During 5.13 dev cycle HELEMs started to leak on copy
+ *PEEPEENESS = (defined $ENV{DBICTEST_ALL_LEAKS}
+ # request for all tests would force "non-leaky" illusion and vice-versa
+ ? ! $ENV{DBICTEST_ALL_LEAKS}
+
+ # otherwise confess that this perl is busted ONLY on smokers
+ : do {
+ if (eval { DBICTest::RunMode->is_smoker }) {
+
+ # leaky 5.13.6 (fixed in blead/cefd5c7c)
+ if ($] == '5.013006') { 1 }
+
+ # not sure why this one leaks, but disable anyway - ANDK seems to make it weep
+ elsif ($] == '5.013005') { 1 }
+
+ else { 0 }
+ }
+ else { 0 }
+ }
+ ) ? sub () { 1 } : sub () { 0 };
}
use mro 'c3';
use strict;
use warnings;
+# This is here instead of DBIx::Class because of load-order issues
+BEGIN {
+ ## FIXME FIXME FIXME - something is tripping up V::M on 5.8.1, leading
+ # to segfaults. When n::c/B::H::EndOfScope is rewritten in terms of tie()
+ # see if this starts working
+ *DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN = ($] < 5.008005)
+ ? sub () { 1 }
+ : sub () { 0 }
+ ;
+}
+
use Carp ();
use namespace::clean ();
);
};
-# FIXME - see below
-BEGIN {
- *__BROKEN_NC = ($] < 5.008003)
- ? sub () { 1 }
- : sub () { 0 }
- ;
-}
sub import {
my (undef, $skip_pattern) = @_;
my $into = caller;
## FIXME FIXME FIXME - something is tripping up V::M on 5.8.1, leading
# to segfaults. When n::c/B::H::EndOfScope is rewritten in terms of tie()
# see if this starts working
- unless __BROKEN_NC();
+ unless DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN();
}
sub unimport {
use lib qw(t/lib);
use DBICTest::RunMode;
+use DBIx::Class;
BEGIN {
plan skip_all => "Your perl version $] appears to leak like a sieve - skipping test"
- if DBICTest::RunMode->peepeeness;
+ if DBIx::Class::_ENV_::PEEPEENESS();
}
use Scalar::Util qw/refaddr reftype weaken/;
# G::L::D is unclean, but we never inherit from it
'DBIx::Class::Admin::Descriptive',
'DBIx::Class::Admin::Usage',
-
- # exempt due to the __BROKEN_NC constant
- 'DBIx::Class::Carp',
) };
my $has_cmop = eval { require Class::MOP };
for my $name (keys %all_method_like) {
- next if ( DBIx::Class::Carp::__BROKEN_NC() and $name =~ /^carp(?:_unique|_once)?$/ );
+ next if ( DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN() and $name =~ /^carp(?:_unique|_once)?$/ );
# overload is a funky thing - it is neither cleaned, and its imports are named funny
next if $name =~ /^\(/;
}
}
- next if DBIx::Class::Carp::__BROKEN_NC();
+ next if DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN();
# some common import names (these should never ever be methods)
for my $f (qw/carp carp_once carp_unique croak confess cluck try catch finally/) {
# kill our $dbh
$schema_autorecon->storage->_dbh(undef);
- ok (! defined $orig_dbh, 'Parent $dbh handle is gone');
+
+ TODO: {
+ local $TODO = "Perl $] is known to leak like a sieve"
+ if DBIx::Class::_ENV_::PEEPEENESS();
+
+ ok (! defined $orig_dbh, 'Parent $dbh handle is gone');
+ }
}
else {
# wait for parent to kill its $dbh
# try to do something dbic-esque
$rs->create({ name => "Hardcore Forker $$" });
- ok (! defined $orig_dbh, 'DBIC operation triggered reconnect - old $dbh is gone');
+
+ TODO: {
+ local $TODO = "Perl $] is known to leak like a sieve"
+ if DBIx::Class::_ENV_::PEEPEENESS();
+
+ ok (! defined $orig_dbh, 'DBIC operation triggered reconnect - old $dbh is gone');
+ }
exit 0;
}
}
sub __mk_disconnect_guard {
- return if DBICTest::RunMode->peepeeness; # leaks handles, delaying DESTROY, can't work right
+ return if DBIx::Class::_ENV_::PEEPEENESS(); # leaks handles, delaying DESTROY, can't work right
my $db_file = shift;
return unless -f $db_file;
}
}
-sub peepeeness {
- return ! $ENV{DBICTEST_ALL_LEAKS} if defined $ENV{DBICTEST_ALL_LEAKS};
-
- # don't smoke perls with known issues:
- if (__PACKAGE__->is_smoker) {
- if ($] == '5.013006') {
- # leaky 5.13.6 (fixed in blead/cefd5c7c)
- return 1;
- }
- elsif ($] == '5.013005') {
- # not sure why this one leaks, but disable anyway - ANDK seems to make it weep
- return 1;
- }
- }
-
- return 0;
-}
-
# Mimic $Module::Install::AUTHOR
sub is_author {
# exception fallback:
SKIP: {
- if (DBICTest::RunMode->peepeeness) {
+ if (DBIx::Class::_ENV_::PEEPEENESS()) {
skip "Your perl version $] appears to leak like a sieve - skipping garbage collected \$schema test", 1;
}