GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::LEAKTRACE::JA (3)

.ds Aq ’

NAME

Test::LeakTrace::JA - XXXXXXXXXXX

CONTENTS

VERSION

This document describes Test::LeakTrace version 0.15.

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

PerlXGCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Test::LeakTrceXXXXXXXXXXXXXXXXXXXXXXXXXXXXTest::BuilderXXXXXXXXXXXXXXXXXXXXXXXXPerlXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPerlXXXXXXXXXXXXXXXXXSXXXXXXPerlXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXX<B>XXXB>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPerlXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

INTERFACE

    Exported functions

leaked_info { BLOCK }

BLOCKXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[$ref, $file, $line]XXXXXXXXXXXX

XXXXXXXXPerlXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPerlXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPerlXXXXXXXXXXXXXXXXXXXXXData::DumperXXXXXXXXXXXXXXXX

leaked_refs { BLOCK }

BLOCKXXXXXXXXXXSVXXXXXXXXXXXXXXXXX

map{ $_->[0] } leaked_info{ BLOCK }XXXXXXXXXXXXXX

leaked_count { BLOCK }

BLOCKXXXXXXXXXXSVXXXXXXXXXXXXXXXX

leaked_info()Xleaked_refs()XXXXXXXXXXXXXXXXXXXXX leaked_count()XXXXXXXXXXXXXXX

leaktrace { BLOCK } ?($mode | \&callback)

BLOCKXXXXXXXXXXXXXXXXXXX*STDERRXXXXXXX

XXXXXXXXXX$modeXXXXXXXXXXXXXX XXXXX$modeXXXXXXXXX
-simple XXXXXXXXXXXXXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXX
-sv_dump <B>-simpleB>XXXXXsv_dump()XSVXXXXXXXXXXX XXXXDevel::Peek::Dump()XXXXXXXXXXX
-lines <B>-simpleB>XXXXXXXXXXXXXXXXXXXXXXXXXXXX
-verbose <B>-simpleB>X<B>-sv_dumpB>X<B>-linesB>XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \&callbackXXXXXXSVXXXXXXXXXXXXXXXXXXSVXXXXXXXXXXXXXXXXXX3XXXX

no_leaks_ok { BLOCK } ?$description

BLOCKXXXXXXXXXXXXXXXXXXX XXXTest::BuilderXXXXXXXXXXXX

XXXBLOCKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

leaks_cmp_ok { BLOCK } $cmp_op, $count, ?$description

BLOCKXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXTest::BuilderXXXXXXXXXXXX

XXXBLOCKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Script interface

Devel::LeakTraceXXXXXXXXXXXXXXXXXXXXTest::LeakTrace::ScriptXXXXXXXXuse Test::LeakTrace::ScriptXXXXXXleaktrace()XXXXXX



        $ 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

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



        #!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::LeakTraceXXXXXXXXXXXXXXXXXXXPerlXXXXXSVXXXXXXXXXXXXXXXXXXXXXXsv.cXXXXXXXXXX XXXXXXXXXsv.cXXXS_visit()XXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXPerlXXXXXXXXXXXXXXXXXX



        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;



XXXXXSVXXXXXXXXXXXXXXXXXXXXleaked_refs()Xleaked_count()XXXXXXXXXXXXXXSVXXXXXXXXXXXXX

XXXXXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPerl 5.10XXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-DDEBUG_LEAKING_SCALARSXXXXPerlXXXXXXXXXXXXXXX

XXXXTest::LeakTraceXXXXXXXPL_runopsXXXXXXPerl VMXOPXXXXXXXX1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXPerlXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXno_leaks_ok()XXXXXXXXXXXXleaked_count()XXXXXXSVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXleaktrace()XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

DEPENDENCIES

Perl 5.8.1 or later, and a C compiler.

CAVEATS

Test::LeakTraceXDevel::CoverXXXXXXXXXXXXXXXX XXXXXXDevel::CoverXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::LEAKTRACE::JA (3) 2014-11-13

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.