hi all

a while ago Ken Coar brought up that Apache-Test doesn't print the final
test count when there are errors.  that is, we currently do this:

# Failed test 20 in t/apache/contentlength.t at line 54 fail #10
FAILED tests 2, 6, 10, 14, 16, 18, 20
        Failed 7/20 tests, 65.00% okay
Failed Test              Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
Failed 1/1 test scripts, 0.00% okay. 7/20 subtests failed, 65.00% okay.
[warning] server localhost.localdomain:8529 shutdown

instead of this

# Failed test 20 in t/apache/contentlength.t at line 54 fail #10
FAILED tests 2, 6, 10, 14, 16, 18, 20
        Failed 7/20 tests, 65.00% okay
Failed Test              Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/apache/contentlength.t               20    7  35.00%  2 6 10 14 16 18 20
Failed 1/1 test scripts, 0.00% okay. 7/20 subtests failed, 65.00% okay.
[warning] server localhost.localdomain:8529 shutdown

note the absence of the "Failed 1/1..." stuff in what we have currently.

well, I finally figured out why.  attached is a patch that "fixes" the
problem.  however, as you can see the installed SIG{__DIE__} handler (from
TestRun.pm) is keeping us from simply putting Test::Harness::runtests in an
eval block.  so the "fix" isn't really a fix until we figure out some other
stuff, and it may not be "fix"able at all.

anyone with insight into the current SIG{__DIE__} foo? it's in the ToDo as
something to consider removing, but I'm not sure how easy that would be.

--Geoff
Index: lib/Apache/TestHarness.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestHarness.pm,v
retrieving revision 1.18
diff -u -r1.18 TestHarness.pm
--- lib/Apache/TestHarness.pm	4 Mar 2004 05:51:31 -0000	1.18
+++ lib/Apache/TestHarness.pm	5 May 2004 19:14:56 -0000
@@ -167,7 +167,12 @@
         $ENV{HTTPD_TEST_SUBTESTS} = "@subtests";
     }
 
-    Test::Harness::runtests($self->get_tests($args, @_));
+    eval {
+       local $SIG{__DIE__};
+       Test::Harness::runtests($self->get_tests($args, @_));
+    };
+
+    print $@ if $@;
 }
 
 1;

Reply via email to