Test to run under Apache user to verify that Poratl free memory. Can not be run under "make test" because it has to read lemonldap-ng.ini.

To be run before release (OK for 1.0)
This commit is contained in:
Xavier Guimard 2010-11-27 19:42:35 +00:00
parent f2b7f8cdfd
commit 82eb262287

View File

@ -0,0 +1,28 @@
#!/usr/bin/perl
use Test::More;
use Test::Weaken qw(leaks);
use Lemonldap::NG::Portal;
my $p;
my $tester = Test::Weaken::leaks(
{ constructor => sub {Lemonldap::NG::Portal::SharedConf->new()},
destructor => sub {my $p = shift;undef $p;undef $Lemonldap::NG::Portal::SharedConf::confCached},
}
);
if ($tester) {
my $unfreed_proberefs = $tester->unfreed_proberefs();
my $unfreed_count = @{$unfreed_proberefs};
printf "Test 2: %d of %d original references were not freed\n",
$tester->unfreed_count(), $tester->probe_count()
or Carp::croak("Cannot print to STDOUT: $ERRNO");
print "These are the probe references to the unfreed objects:\n"
or Carp::croak("Cannot print to STDOUT: $ERRNO");
for my $ix ( 0 .. $#{$unfreed_proberefs} ) {
print Data::Dumper->Dump( [ $unfreed_proberefs->[$ix] ],
["unfreed_$ix"] )
or Carp::croak("Cannot print to STDOUT: $ERRNO");
}
}
ok(!$tester);