NAME

Test::LeakTrace - Traces memory leaks (EXPERIMENTAL)

VERSION

This document describes Test::LeakTrace version 0.02.

SYNOPSIS

use Test::LeakTrace;

# simple report
leaktrace{
	# ...
};

# with verbose output
leaktrace{
	# ...
} -verbose;

# with callback
leaktrace{
	# ...
} sub{ 
	my($ref, $file, $line) = @_;
	warn "leaked $ref from $file line\n";
};

my @refs = leaked_refs{
	# ...
};
my @info = leaked_info{
	# ...
};

my $count = leaked_count{
	# ...
};

# standard test interface
use Test::LeakTrace;

not_leaked{
	# ...
} "description";

leaked_cmp_ok{
	# ...
} '<', 10;

# script interface like Devel::LeakTrace
use Test::LeakTrace::Script;
# ...

$ LEAKTRACE_VERBOSE=1 perl -MTest::LeakTrace::Script script.pl

DESCRIPTION

Test::LeakTrace traces memory leakes.

(TODO)

INTERFACE

Exported functions

leaktrace { BLOCK }
leaktrace { BLOCK } -verbose
leaktrace { BLOCK } \&callback
leaked_refs { BLOCK }
leaked_info { BLOCK }
leaked_count { BLOCK }
not_leaked { BLOCK } ?$description

Checks that BLOCK does not leaks SVs. This is a test function using Test::Builder.

Note that BLOCK is called more than once. This is because BLOCK might prepare caches which are not memory leaks.

leaked_cmp_ok { BLOCK } $op, ?$description

Checks that BLOCK leakes a specific number of SVs. This is a test function using Test::Builder.

Note that BLOCK is called more than once. This is because BLOCK might prepare caches which are not memory leaks.

DEPENDENCIES

Perl 5.8.1 or later, and a C compiler.

BUGS

No bugs have been reported.

Please report any bugs or feature requests to the author.

SEE ALSO

Devel::LeakTrace.

Devel::LeakTrace::Fast.

Test::TraceObject.

Test::Weak.

AUTHOR

Goro Fuji <gfuji(at)cpan.org>.

LICENSE AND COPYRIGHT

Copyright (c) 2009, Goro Fuji. Some rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.