stas 2004/03/10 14:59:09
Modified: ModPerl-Registry/t basic.t Added: ModPerl-Registry/t/cgi-bin exit.pl Log: a very simple exit test Revision Changes Path 1.1 modperl-2.0/ModPerl-Registry/t/cgi-bin/exit.pl Index: exit.pl =================================================================== # XXX: exit should work by stopping the script, but not quitting the # interpreter, though it's not trivial to make an automated test since # what you really want to check whether the process didn't quit after # exit was called. Things become more complicated with # ithreads-enabled perls where one process may have many interpreters # and you can't really track those at the moment. So this test needs # more work. print "Content-type: text/plain\n\n"; print "before exit"; exit; print "after exit"; 1.17 +16 -2 modperl-2.0/ModPerl-Registry/t/basic.t Index: basic.t =================================================================== RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v retrieving revision 1.16 retrieving revision 1.17 diff -u -u -r1.16 -r1.17 --- basic.t 4 Dec 2003 07:20:29 -0000 1.16 +++ basic.t 10 Mar 2004 22:59:09 -0000 1.17 @@ -3,7 +3,7 @@ use Apache::Test; use Apache::TestUtil; -use Apache::TestRequest qw(GET GET_BODY HEAD); +use Apache::TestRequest; use Apache::TestConfig (); use Apache::TestUtil qw(t_catfile_apache); @@ -16,7 +16,7 @@ my @aliases = sort keys %modules; -plan tests => @aliases * 4 + 3; +plan tests => @aliases * 5 + 3; my $vars = Apache::Test::config()->{vars}; my $script_file = t_catfile_apache $vars->{serverroot}, 'cgi-bin', 'basic.pl'; @@ -69,6 +69,20 @@ "$modules{$alias} mod_cgi-like environment pre-set", ); } + + +# exit +for my $alias (@aliases) { + my $url = "/$alias/exit.pl"; + + ok t_cmp( + "before exit", + GET_BODY_ASSERT($url), + "$modules{$alias} mod_cgi-like environment pre-set", + ); +} + + # test method handlers {