Ignore:
Timestamp:
10/24/09 11:33:52 (3 years ago)
Author:
SvenDowideit
Message:

Item2286: update the memory cycle tests and add memory leak tests

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/Release01x00/core/tools/MemoryLeakTests.pl

    r1065 r5373  
    1919 
    2020use strict; 
    21 use Devel::Monitor qw(:all); 
     21use Devel::Leak::Object qw{ GLOBAL_bless }; 
     22 
    2223 
    2324BEGIN { 
    24     use File::Spec; 
    25  
    26     unshift @INC, split(/:/, $ENV{FOSWIKI_LIBS} || '../lib' ); 
    27  
    28     # designed to be run within a SVN checkout area 
    29     my @path = split( /\/+/, File::Spec->rel2abs($0) ); 
    30     pop(@path); # the script name 
    31  
    32     while (scalar(@path) > 0) { 
    33         last if -d join( '/', @path).'/twikiplugins/BuildContrib'; 
    34         pop( @path ); 
     25    if ( defined $ENV{GATEWAY_INTERFACE} ) { 
     26        $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI'; 
     27        use CGI::Carp qw(fatalsToBrowser); 
     28        $SIG{__DIE__} = \&CGI::Carp::confess; 
    3529    } 
    36  
    37     if(scalar(@path)) { 
    38         unshift @INC, join( '/', @path ).'/lib'; 
    39         unshift @INC, join( '/', @path ).'/twikiplugins/BuildContrib/lib'; 
     30    else { 
     31        $Foswiki::cfg{Engine} = 'Foswiki::Engine::CLI'; 
     32        require Carp; 
     33        $SIG{__DIE__} = \&Carp::confess; 
    4034    } 
     35    $ENV{FOSWIKI_ACTION} = 'view'; 
     36    @INC = ('../bin', grep { $_ ne '.' } @INC); 
     37    require 'setlib.cfg'; 
    4138} 
    4239 
     
    4542 
    4643{ 
    47     my $twiki = new Foswiki(); 
    48     $Foswiki::Plugins::SESSION = $twiki; 
    49     monitor('TWiki' => \$Foswiki::Plugins::SESSION ); 
    50  
    51     Foswiki::UI::run( \&Foswiki::UI::View::view ); 
    52      
    53     #NOTE that Foswiki::finish() is hiding many circular references by foricbly clearing 
    54     #them with the %$this = (); its worth commenting out this line once in a while to  
    55     #see if its gettign worse (56 are found as of Jun2006) 
    56      
    57     print_circular_ref(\$Foswiki::Plugins::SESSION ); 
     44##    $Foswiki::Plugins::SESSION = new Foswiki(); 
     45#    Foswiki::UI::run( \&Foswiki::UI::View::view ); 
     46#    $Foswiki::Plugins::SESSION->finish(); 
     47#    undef $Foswiki::Plugins::SESSION; 
     48$Foswiki::engine->run(); 
    5849} 
    5950 
Note: See TracChangeset for help on using the changeset viewer.