Skip to content

Commit

Permalink
Item2286: Make it easier to use Devel::Leak::Object to detect memory …
Browse files Browse the repository at this point in the history
…leaks

git-svn-id: http://svn.foswiki.org/trunk@8651 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelTempest authored and MichaelTempest committed Aug 22, 2010
1 parent 56190d5 commit 26f8082
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions UnitTestContrib/lib/Unit/TestRunner.pm
Expand Up @@ -16,8 +16,14 @@ use Devel::Symdump;
use Error qw(:try);
use File::Spec;

#use Devel::Leak::Object qw{ GLOBAL_bless };
#$Devel::Leak::Object::TRACKSOURCELINES = 1;
sub CHECKLEAK {0}
BEGIN {
if (CHECKLEAK) {
eval "use Devel::Leak::Object qw{ GLOBAL_bless };";
die $@ if $@;
$Devel::Leak::Object::TRACKSOURCELINES = 1;
}
}

sub new {
my $class = shift;
Expand Down Expand Up @@ -359,7 +365,7 @@ sub runOne {
}
foreach my $test (@tests) {

#Devel::Leak::Object::checkpoint();
Devel::Leak::Object::checkpoint() if CHECKLEAK;
print "\t$test\n";
$action .= "\n# $test\n ";
$tester->set_up();
Expand Down

0 comments on commit 26f8082

Please sign in to comment.