From: Peter Rabbitson Date: Wed, 24 Sep 2014 15:12:34 +0000 (+0200) Subject: Accomodate broken Test::More trials a bit better X-Git-Tag: v0.082800~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b77a61d867a1a03ec0be1cb63365c66f97a46e7c;p=dbsrgits%2FDBIx-Class.git Accomodate broken Test::More trials a bit better --- diff --git a/t/lib/DBICTest/Util/LeakTracer.pm b/t/lib/DBICTest/Util/LeakTracer.pm index 645bc24..d2ccc25 100644 --- a/t/lib/DBICTest/Util/LeakTracer.pm +++ b/t/lib/DBICTest/Util/LeakTracer.pm @@ -342,9 +342,16 @@ sub assert_empty_weakregistry { } END { - if ($INC{'Test/Builder.pm'}) { - my $tb = Test::Builder->new; - + if ( + $INC{'Test/Builder.pm'} + and + my $tb = do { + local $@; + my $t = eval { Test::Builder->new } + or warn "Test::Builder->new failed:\n$@\n"; + $t; + } + ) { # we check for test passage - a leak may be a part of a TODO if ($leaks_found and !$tb->is_passing) {