httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestServer.pm
Date Sun, 06 Jan 2002 18:53:58 GMT
On Mon, 7 Jan 2002, Stas Bekman wrote:
 
> I needed it TestRun, whereas the fork was happening in TestServer. So it 
> was definitely easier to do it locally.

are you saying the following patch would not work?

Index: Apache-Test/lib/Apache/TestRun.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.82
diff -u -r1.82 TestRun.pm
--- Apache-Test/lib/Apache/TestRun.pm	6 Jan 2002 07:08:05 -0000	1.82
+++ Apache-Test/lib/Apache/TestRun.pm	6 Jan 2002 18:45:46 -0000
@@ -248,6 +248,9 @@
     $opts->{'run-tests'} ||= @$tests;
 }
 
+my $parent_pid = $$;
+sub is_parent { $$ == $parent_pid }
+
 my $caught_sig_int = 0;
 
 sub install_sighandlers {
@@ -276,9 +279,8 @@
     #must eval "" to "install" this END block, otherwise it will
     #always run, a subclass might not want that
 
-    eval 'my $parent_pid = $$;
-          END {
-             return unless $$ == $parent_pid; # because of fork
+    eval 'END {
+             return unless is_parent(); # because of fork
              local $?; # preserve the exit status
              eval {
                 Apache::TestRun->new(test_config =>



Mime
View raw message