Changeset 5392
- Timestamp:
- 10/29/09 11:09:03 (2 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
MailerContrib/test/unit/MailerContrib/MailerContribSuite.pm (modified) (1 diff)
-
UnitTestContrib/lib/Unit/TestRunner.pm (modified) (3 diffs)
-
UnitTestContrib/test/unit/AccessControlTests.pm (modified) (1 diff)
-
UnitTestContrib/test/unit/ExceptionTests.pm (modified) (1 diff)
-
WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm (modified) (1 diff)
-
WysiwygPlugin/test/unit/WysiwygPlugin/WysiwygPluginTests.pm (modified) (3 diffs)
-
core/lib/Foswiki.pm (modified) (3 diffs)
-
core/tools/MemoryCycleTests.pl (modified) (2 diffs)
-
core/tools/extender.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/MailerContrib/test/unit/MailerContrib/MailerContribSuite.pm
r5292 r5392 73 73 # Must create a new wiki object to force re-registration of users 74 74 $Foswiki::cfg{EnableEmail} = 1; 75 $this->{session}->finish(); 75 76 $this->{session} = new Foswiki(); 76 77 $this->{session}->net->setMailHandler( \&FoswikiFnTestCase::sentMail ); -
trunk/UnitTestContrib/lib/Unit/TestRunner.pm
r5145 r5392 5 5 use Devel::Symdump; 6 6 use Error qw(:try); 7 #use Devel::Leak::Object qw{ GLOBAL_bless }; 8 #$Devel::Leak::Object::TRACKSOURCELINES = 1; 7 9 8 10 sub new { … … 103 105 die "Test suite $suite aborted\n" unless $completed; 104 106 } 105 }107 } 106 108 107 109 if ( $this->{unexpected_failures} || $this->{unexpected_passes} ) { … … 267 269 } 268 270 foreach my $test (@tests) { 271 #Devel::Leak::Object::checkpoint(); 269 272 print "\t$test\n"; 270 273 $tester->set_up(); -
trunk/UnitTestContrib/test/unit/AccessControlTests.pm
r3745 r5392 20 20 my $this = shift; 21 21 $this->SUPER::set_up(); 22 $this->{session} = new Foswiki();23 22 24 23 my $topicObject = Foswiki::Meta->new( -
trunk/UnitTestContrib/test/unit/ExceptionTests.pm
r4645 r5392 130 130 $this->assert_matches( qr/^the rat$/m, $output ); 131 131 $this->assert_matches( qr/^phlegm$/m, $output ); 132 133 $session->finish(); 132 134 } 133 135 -
trunk/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm
r5310 r5392 2116 2116 } 2117 2117 $query->path_info("/Current/TestTopic"); 2118 $this->{session}->finish() if (defined($this->{session})); 2118 2119 $this->{session} = new Foswiki( undef, $query ); 2119 2120 $Foswiki::Plugins::SESSION = $this->{session}; -
trunk/WysiwygPlugin/test/unit/WysiwygPlugin/WysiwygPluginTests.pm
r4645 r5392 94 94 $query->method('GET'); 95 95 96 $Foswiki::Plugins::SESSION = new Foswiki( 'guest', $query ); 96 $this->{session}->finish(); 97 $this->{session} = new Foswiki( 'guest', $query ); 98 $Foswiki::Plugins::SESSION = $this->{session}; 97 99 98 100 # charset definition affects output, so it is a response method and … … 174 176 $this->assert( $text eq $out, 175 177 "'" . anal($out) . "' !=\n'" . anal($text) . "'" ); 178 $foswiki->finish(); 176 179 } 177 180 … … 226 229 $this->assert_str_equals( $text, $out, 227 230 "'" . anal($out) . "' !=\n'" . anal($text) . "'" ); 231 $foswiki->finish(); 228 232 } 229 233 -
trunk/core/lib/Foswiki.pm
r5279 r5392 1554 1554 $query ||= new Foswiki::Request(); 1555 1555 my $this = bless( { sandbox => 'Foswiki::Sandbox' }, $class ); 1556 1556 1557 $this->{request} = $query; 1557 1558 $this->{cgiQuery} = $query; # for backwards compatibility in contribs … … 1908 1909 =begin TML 1909 1910 1911 ---++ ObjectMethod DESTROY() 1912 1913 called by Perl when the Foswiki object goes out of scope 1914 (maybe should be used kist to ASSERT that finish() was called.. 1915 1916 =cut 1917 1918 #sub DESTROY { 1919 # my $this = shift; 1920 # $this->finish(); 1921 #} 1922 1923 =begin TML 1924 1910 1925 ---++ ObjectMethod finish() 1911 1926 Break circular references. … … 1920 1935 1921 1936 $_->finish() foreach values %{ $this->{forms} }; 1922 $this->{plugins}->finish() if $this->{plugins};1937 $this->{plugins}->finish() if $this->{plugins}; 1923 1938 undef $this->{plugins}; 1924 $this->{users}->finish() if $this->{users};1939 $this->{users}->finish() if $this->{users}; 1925 1940 undef $this->{users}; 1926 $this->{prefs}->finish() if $this->{prefs};1941 $this->{prefs}->finish() if $this->{prefs}; 1927 1942 undef $this->{prefs}; 1928 1943 $this->{templates}->finish() if $this->{templates}; 1929 1944 undef $this->{templates}; 1930 $this->{renderer}->finish() if $this->{renderer};1945 $this->{renderer}->finish() if $this->{renderer}; 1931 1946 undef $this->{renderer}; 1932 $this->{net}->finish() if $this->{net};1947 $this->{net}->finish() if $this->{net}; 1933 1948 undef $this->{net}; 1934 $this->{store}->finish() if $this->{store};1949 $this->{store}->finish() if $this->{store}; 1935 1950 undef $this->{store}; 1936 $this->{search}->finish() if $this->{search};1951 $this->{search}->finish() if $this->{search}; 1937 1952 undef $this->{search}; 1938 $this->{attach}->finish() if $this->{attach};1953 $this->{attach}->finish() if $this->{attach}; 1939 1954 undef $this->{attach}; 1940 $this->{security}->finish() if $this->{security};1955 $this->{security}->finish() if $this->{security}; 1941 1956 undef $this->{security}; 1942 $this->{i18n}->finish() if $this->{i18n};1957 $this->{i18n}->finish() if $this->{i18n}; 1943 1958 undef $this->{i18n}; 1944 1959 $this->{cache}->finish() if $this->{cache}; 1945 1960 undef $this->{cache}; 1961 #TODO: the logger doesn't seem to have a finish... 1962 # $this->{logger}->finish() if $this->{logger}; 1963 undef $this->{logger}; 1946 1964 1947 1965 undef $this->{_HTMLHEADERS}; -
trunk/core/tools/MemoryCycleTests.pl
r1065 r5392 21 21 use Devel::Monitor qw(:all); 22 22 23 23 24 BEGIN { 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; 35 29 } 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; 40 34 } 35 $ENV{FOSWIKI_ACTION} = 'view'; 36 @INC = ('../bin', grep { $_ ne '.' } @INC); 37 require 'setlib.cfg'; 41 38 } 42 39 … … 45 42 46 43 { 47 my $twiki = new Foswiki(); 48 $Foswiki::Plugins::SESSION = $twiki; 49 monitor('TWiki' => \$Foswiki::Plugins::SESSION ); 44 my $session = new Foswiki(); 45 46 #NOTE that Foswiki::finish() is hiding many circular references by foricbly clearing 47 #them with the %$this = (); its worth uncommenting this line once in a while to 48 #see if its gettign worse (56 are found as of Jun2006) 49 #*Foswiki::finish = sub {}; 50 51 $Foswiki::Plugins::SESSION = $session; 52 monitor('Foswiki' => \$Foswiki::Plugins::SESSION ); 50 53 51 54 Foswiki::UI::run( \&Foswiki::UI::View::view ); 52 53 #NOTE that Foswiki::finish() is hiding many circular references by foricbly clearing54 #them with the %$this = (); its worth commenting out this line once in a while to55 #see if its gettign worse (56 are found as of Jun2006)56 55 57 56 print_circular_ref(\$Foswiki::Plugins::SESSION ); -
trunk/core/tools/extender.pl
r5277 r5392 127 127 # Can't do this until we have setlib.cfg 128 128 require Foswiki::Configure::Dependency; 129 130 $session->finish(); 131 undef $session; 129 132 } 130 133
Note: See TracChangeset
for help on using the changeset viewer.
