Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Test::LeakTrace::JA(3)User Contributed Perl DocumentatioTest::LeakTrace::JA(3)

NAME					  _
       Test::LeakTrace::JA - a!acaaaaa1/4a ae?1/2e.!aa

VERSION
       This document describes Test::LeakTrace version 0.16.

SYNOPSIS
	       use Test::LeakTrace;

	       # simple	report
	       leaktrace{
		       # ...
	       };

	       # 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;

	       no_leaks_ok{
		       # ...
	       } "description";

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

DESCRIPTION	  _									_
       Perla(R)GCa aaaa!a~a^3a^1a<<a|a^3a?ac"aaaa(R)aaa(R)a<section>i1/4aaaa,a<section>a aaeae3/4aaaa?axaa^3a<degree>aaeccoa<section>aaaa"aa1/2aeeao|ae<<ea<section>aaaa"aaa(C)ae<degree>aa(_)a(C)c^1aaaa3_4aa					   _		   _
       aa(R)a,ae^1a<section>i1/4a3/4ac<degree>ac<section>aeae3/4a<section>aaaaaa"i1/4Ca~aa<<a<section>a(R)aea1/2a<section>aa^1aaaaaaa(C)i1/4ae!c^1aaaaxaaaa3/4aaaaaa(R)ae!c^1a(R)a>>a"aa(C)a a!acaaaaa1/4a a<<ecaaaa"a<section>aaai1/4a!acaaaaa1/4a ae?1/2e.!aaaa"a ea,,a<<ee|aaea^2e!a<section>aa
			_	      _															      _
       "Test::LeakTrce"a a!acaaaaa1/4a ae?1/2e.!aaaaa(R)aaaxaa(R)a|a1/4aaLaaaaLa""Test::Builder"aa1/4a^1a(R)aa^1aecae<degree>aaea3/4aa3/4aaaa(R)aca,aYa1/4a<<a_Perla(R)a!acaaaca-																			   _
       a+-a1/4a.a<section>a^3a.a^1aa a<section>aaacaaa1/4aae<micro><degree>ae>>aaaai1/4SVa<<ecaaaa"a<section>aaa<degree>a,aaaaa^3a1/4aa(R)a(C)aaaa!acaaaaa1/4a a<section>aaexaoa<section>aa3/4aaaxa3/4ai1/4Perla~aa<<a<section>a(R)a3/4ac<degree>ac<section>aa<section>aa"aa|i1/4XSaca,aYa1/4a<<aPerleaeo<<a(R)aa<degree>a<<aaa!acaaaaa1/4a ae?1/2e.!aaaa"aa<section>aa3/4aa
			  _   _																       _
       aaa<section>~a<I>a~a1/4~a a"a i1/4c^1a(R)a(R)a^1a^3a1/4aaa<section>ae<degree>aa<<a1/2aeaaa|i1/4aa(R)a^1a^3a1/4ac<micro>aoa3/4a<<aae(R)aLa|aaaxaaea^3aa3/4aaaaa	i1/4ae<degree>aa<<a1/2aeaaaa<degree>a-
       a1/4aa<<aaaxaPerlaaee>>a(R)aa!a<<a1/2aeaaa-	_
       aLaa.aYa(R)axaa<<a?a3/4aaaa"aa<degree>i1/4aaa1/4a e?1/2e.!ae!aLa|aaaea,-_       _										 _
       a<<ae<degree>aa<<aaaxaa<_icro>aa<<a_/4aa^3aa(R)c3/4(C)aaa<degree>i1/4aaa	aaa1/4a	a"a?aaaaa3/4aaa3/4ai1/4c<paragraph>ae?aaa!a1/2aaaa1/4a^3aoaaai1/4aaaa,a<section>a aaa1/2aeaaaaaa aa<section>ae<section>aaaa-
       aLaa.aYacaeaai1/4aaa1/4a	aa +-aaaaa e1/2ae<section>aaaa3/4aa

INTERFACE
   Exported functions
       "leaked_info { BLOCK }"

       BLOCKaa(R)e_ai1/4e?_/2e.!c<micro>aeaaaa^1aa<section>e?aa3/4aa
       c<micro>aea aaa1/4a aaaxa(R)aaaa!a~a^3a^1i1/4aa!axa<<ai1/4e!caa.a(R)a,e|c' aaeaxeai1/4axa3/4a"[$ref,
       $file, $line]"a(R)aaa^1aa"aaaLa|aa3/4aa
				_				  _													_													     _				     _					  _													     _
       aaai1/4aa(R)ecae<degree>a Perlae"a<section>a1/2?c"aaaxae?aa e1/2ae<section>aaaa3/4aaaa(R)aaaaae"c"a(R)axaaxae'aaa"Perla(R)e!c<degree>aca<<e'a1/2caaa1/2+-e?aa,aaa e1/2ae<section>aaaa(R)a<section>ae^3"aeaa|aa aaaa3/4ai1/4eaaaaa.aYa(R)e|c' a"aa|i1/4aaaa!a~a^3a^1a<section>a aaaeaaaaa.aYaaeaa1/2aa<<a3/4aaa e1/2ae<section>aaaa3/4aaaa(R)aaaaaxa ea,,Perla~aa<<a<section>aea1/2aaaa"aa<section>aa3/4aaaaa"aa<degree>"Data::Dumper"aaa(C)a<section>aoaaaaa"a a<section>aa3/4aaa

       "leaked_refs { BLOCK }"
			       _
       BLOCKaa(R)e!ai1/4aaa1/4a	aaSVa(R)aaaa!a~a^3a^1a(R)aaa^1aae?aa3/4aa

       "map{ $_->[0] } leaked_info{ BLOCK
       }"a"aaa<section>aai1/4aae<<ea<section>aa

       "leaked_count { BLOCK }"
			       _
       BLOCKaa(R)e!ai1/4aaa1/4a	aaSVa(R)aaaa!a~a^3a^1a(R)aae<degree>ae?aa3/4aa

       "leaked_info()"aaa^1a<<a(C)a^3a^3aa-	  _
       a^1aa<section>a aae<degree>ae?aa3/4aai1/4 "leaked_count()"a a^3a^3aa-
       a^1aa<<a3/4aaa3/4aaa

       "leaktrace { BLOCK } ?($mode | \_callback)"

       BLOCKaa(R)e!ai1/4aa(R)a,-	 _
       a<section>e<micro>.aaa!acaaaaa1/4a a*STDERRa<<a +-aaa3/4aa
		    _	       _
       a!acaaaaa1/4a_a(R)a +-aa	$modea<section>aea(R)aaaca1/4aa<<a3/4aa3/4aa
       aaa>>aa$modea a>>Ya,a(R)eaa<section>ai1/4

       -simple					   _
	   aaa(C)a<<aa(R)aca1/4aa<section>aaaaa1/4a aaSVa(R)aa"acaa~a^1i1/4aa!axa<<ai1/4e!caa.aa +-aaa3/4aa

       -sv_dump
	   -simplea<<a aa|i1/4"sv_dump()"a<section>SVa(R)a,eo<<aaa^3aaa3/4aa
	   aaa i1/4"Devel::Peek::Dump()"a(R)aoaa"a>>a1/4aaa<section>aa

       -lines			     _
	   -simplea<<a aa|i1/4aaa1/4a aa|aaa"e|aaae!a(R)a"e3/4oaaoaaa3/4aa

       -verbose
	   -simplea"-sv_dumpa"-linesa(R)a"a|aaoaaa3/4aa
							     _
       aac'<degree>_aaaa<pa_agraph>_a3/4!a(R)aaa<<a^3a1/4a<<aaa aaea(R)aaaaaa<sec_ion>aa3/4aa
       \_callbacka aaa1/4a aaSVae a<<a1/4a^3aoaai1/4aa(R)a1/4ae<degree>a aaa1/4a aaSVa(R)aaaa!a~a^3a^1i1/4aa!axa<<ai1/4e!caa.a(R)3axa<section>aa

       "no_leaks_ok { BLOCK } ?$description"
			    _
       BLO_Ka<<a!acaaaaa1/4a aaaaaa"aa^1aaa3/4aa
       aaa "Test::Builder"aa1/4a^1a(R)aa^1aecae<degree>a<section>aa
		    _				   _
       aaai1/4BLOCKa exaa(R)e!aaa3/4aaaaa i1/4aaa(R)a(R)e!a<section>a-
       aLaa.aYac"aeaaa e1/2ae<section>aeae(R)aaaaa<section>aa

       "leaks_cmp_ok { BLOCK } $cmp_op,	$count,	?$description"
			     _					    _
       BLO_Ka(R)a!acaaaaa1/4a ae<degree>a"c^1a(R)a(R)ae<degree>axaae e1/4aaaa^1aae!aa3/4aa
       aaa "Test::Builder"aa1/4a^1a(R)aa^1aecae<degree>a<section>aa
		    _				   _
       aaai1/4BLOCKa exaa(R)e!aaa3/4aaaaa i1/4aaa(R)a(R)e!a<section>a-
       aLaa.aYac"aeaaa e1/2ae<section>aeae(R)aaaaa<section>aa

   Script interface				  _		  _
       "Devel::LeakTrace"a"aae<section>a<<i1/4a^1a aaaaa(_)aaa1/4a e?1/2e.!a(R)aaa<<"Test::LeakTrace::Script"aaea3/4aaa3/4aa"use
       Test::LeakTrace::Script"a(R)Le"a(R)a1/4ae<degree>a "leaktrace()"a"aaa<section>aa

	       $ TEST_LEAKTRACE=-sv_dump perl -MTest::LeakTrace::Script	script.pl
	       $ perl -MTest::LeakTrace::Script=-verbose script.pl

	       #!perl
	       # ...

	       use Test::LeakTrace::Script sub{
		       my($ref,	$file, $line) =	@_;
		       # ...
	       };

	       # ...

EXAMPLES
   Testing modules			     _		    _		_
       a>>Ya,a aca,aYa1/4a<<a(R)a!acaaaaa1/4a aaa<section>aa aaaa^1aa^1a aaaaa(R)aa^3aa~a1/4aa<section>aa

	       #!perl -w
	       use strict;
	       use constant HAS_LEAKTRACE => eval{ require Test::LeakTrace };
	       use Test::More HAS_LEAKTRACE ? (tests =>	1) : (skip_all => 'require Test::LeakTrace');
	       use Test::LeakTrace;

	       use Some::Module;

	       leaks_cmp_ok{
		       my $o = Some::Module->new();
		       $o->something();
		       $o->something_else();
	       } '<', 1;

GUTS			 _						   _
       "Test::LeakTrace"a acaaa1/4aae<micro><degree>ae>>aa3/4aaacaaa1/4aa"a i1/4Perlaa1/2aeaaSVa(R)aaa(R)a!acaaaca-
       a+-a1/4a.a<section>a^3a.a^1aa a<secti_n>aai1/4sv.ca<section>a(R)eLaaa|aa3/4aa  _
       acaaa1/4aa(R)e<micro><degree>ae>>a<<a sv.ca<<aa"S_visit()"a(R)a^3a1/4aaaa<<aaaa a-
       ac"aa|aa3/4aa
									_		     _
       aa_i1/4acaaa1/4aae<micro><degree>ae>>aaa<degree>i1/4a!acaaaaa1/4a a(R)aexaoaa(R)aa(R)a c<degree>!aa<<a<section>aaaaa<<aeaa3/4aaa3/4ai1/4a^3a1/4aaa-
       aa_aa(R)e!aaaa<<a,ao|acaaa1/4aae<micro><degree>ae>>ai1/4a"a|a(R)SVa<<aa1/2?c"ae,a?aa(R)a<degree>aa>>aa|aaa3/4aaae~_a<<i1/4a^3a1/4aaa-
       aa_a(R)e!a3/4a<<aaa,ao|acaaa1/4aae<micro><degree>ae>>ai1/4ac"ae,a?a(R)a<degree>aaxaa|aaaa_Vaaaa<degr_e>i1/4aaa a^3a1/4aaa-
       aa aa<section>a1/2aeaai1/4eae3/4aaaaaaLaSVa a"eaa3/4aaaa"a aaaa +-aaaa aa<section>aaa(R)ea<<a i1/4SVa<<a	3/4aa|a1/2?c"ae,a?a(R)a<degree>aa>>aaa^1aa1/4a^1aaaaaai1/4axa^3a<micro>axaaca|aae^3aa?c"aa|axe"a(R)a^3a^3aaa<<a1/2?c"ae,a?a(R)a<degree>aa?a-
       aa3/4aa
       aaaa>>(R)a<<Perla^3a1/4aa<section>ae,aa"a>>Ya,a(R)aaa<<aaaa3/4aa

	       my %used_sv;
	       foreach my $sv(@ARENA){
		       $used_sv{$sv}++;
	       }
	       $block->();

	       my @leaked
	       foreach my $sv(@ARENA){
		       if(not exists $used_sv{$sv}){
			       push @leaked, $sv;
		       }
	       }
	       say 'leaked count: ', scalar @leaked;
	      _												       _				  _
       aaa1/4a aaSVaa3/4aa aaaaaa(R)ae^1ae^3a<section>aaa<section>aaa(R)ei1/4"leaked_refs()"a""leaked_count()"a	aa(R)aaaaae^1ae^3a<section>aaa1/4a aaSVaaa(R)aae<degree>aea?a^1a|aa3/4aa
		     _									      _		       _
       aaai1/4aaa1/4aaaSVa(R)a^1aa1/4aa!a^3aa(R)aea +-i1/4axa3/4aaa!axa<<aae!caa.aa3/4aaaa<<a aaa aa<section>a	a,aaa<section>aaPerl _
       5.10a>>Yea<<a SVaa1/2aeaaaa"aa(R)a^1aa1/4aa!a^3aaea +-ae?1/2e.!aaae(C)e1/2aaaa(R)a<section>aai1/4aa(R)ae(C)e1/2aa(C)c"aaaaa<<a i1/4a^3a^3aaxa(C)aaaa.a<section>a^3a"aa|a<<"-DDEBUG_LEAKING_SCALARS"aa,aa|Perlaaa<<aaaaaaa<degree>aaaa3/4aaa
						   _		   _
       aaa<section>i1/4"Test::LeakTrace"a<secti_n>a ae!a1/4<micro>a e1/2aa"PL_runops"aa(C)c"aa|i1/4Perl			   _			  _	    _
       VMaOPa^3a1/4aaa(R)e!aa1a^1aa1/4aa!a^3aae	a<<acaaa1/4aae<micro><degree>ae>>ai1/4a^1aa1/4aa!a^3aaea +-ae"e^2aa3/4aaaaa i1/41a^1aa1/4aa!a^3aae a<<aa1/4a i1/4a^1axa1/4aa(R)aaaaa|cae!aa(R)a<<c-
       aai1/4ea,,a<<aeeaaeaaa3/4aaaaai1/4Perlac^1ae(R)aaae!a>><paragraph>a(R)a,a<section>aa<<aaaa?e|aaaai1/4aa1/4a,a<section>a^3a<<a3/4a-
       aaae(C)e1/2aa>>a"aa(C)a1/2?c"aaaaaai1/4axaa(R)c<degree>aca<section>aaaaa"aa<section>aa3/4aa
							 _					_						    _									   _			   _
       a3/4ai1/4"no_leaks_ok()"a(R)aaaaaa^1aecae<degree>a a3/4a"leaked_count()"a<section>aaa1/4a aaSVa(R)aae<degree>aa3/4a|aai1/4a?e|a<<a?aa|aaa1/4a aaa1/2c1/2(R)ac^1a(R)aaaaa<<"leaktrace()"aa(R)e!aaaai1/4aa^1aaaeaaaeaa aeea(R)aeaae?1/2e.!a|ca aa3/4aaa

DEPENDENCIES
       Perl 5.8.1 or later, and	a C compiler.

CAVEATS			 _				_
       "Test::LeakTrace"a "Devel::Cover"a"a,c.a<<aaaaa"a a<section>aa3/4aaa		 _
       aaaaLa|i1/4"Devel::Cover"a(R)aa<section>aaa|aaaa"aaexaoaaaa"i1/4aa^1aecae<degree>a a1/2ae!aaa<<aa^1aaaa^1aaa3/4aa

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.

       For guts:

       perlguts.

       perlhack.

       sv.c.

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.

perl v5.32.0			  2017-06-18		Test::LeakTrace::JA(3)

VERSION | SYNOPSIS | INTERFACE | EXAMPLES | DEPENDENCIES | BUGS | SEE ALSO | AUTHOR | LICENSE AND COPYRIGHT

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Test::LeakTrace::JA&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help