Skip to content

Commit

Permalink
Generalize leak-trace handling
Browse files Browse the repository at this point in the history
Disable the leak tests for perls 5.13.5 and 5.13.6 on *smoker only*
  • Loading branch information
ribasushi committed Oct 28, 2010
1 parent c819488 commit d5e5fb4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
10 changes: 5 additions & 5 deletions t/52leaks.t
Expand Up @@ -12,18 +12,18 @@ BEGIN {
}

use Test::More;

use lib qw(t/lib);
use DBICTest::RunMode;
BEGIN {
plan skip_all => '5.13.6 leaks like a sieve (fixed in blead/cefd5c7c)'
if $] == '5.013006';
plan skip_all => "Your perl version $] appears to leak like a sieve - skipping test"
if DBICTest::RunMode->peepeeness;
}

use Scalar::Util qw/refaddr reftype weaken/;
use Carp qw/longmess/;
use Try::Tiny;

use lib qw(t/lib);
use DBICTest::RunMode;

my $have_test_cycle;
BEGIN {
require DBIx::Class::Optional::Dependencies;
Expand Down
2 changes: 1 addition & 1 deletion t/lib/DBICTest.pm
Expand Up @@ -112,7 +112,7 @@ sub _database {
}

sub __mk_disconnect_guard {
return if $] == '5.013006'; # leaks handles, delaying DESTROY, can't work right
return if DBICTest::RunMode->peepeeness; # leaks handles, delaying DESTROY, can't work right

my $db_file = shift;
return unless -f $db_file;
Expand Down
18 changes: 18 additions & 0 deletions t/lib/DBICTest/RunMode.pm
Expand Up @@ -99,6 +99,24 @@ EOE
}
}

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 {

Expand Down

0 comments on commit d5e5fb4

Please sign in to comment.