httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: digging out the missing error message
Date Wed, 05 May 2004 23:15:43 GMT
Geoffrey Young wrote:
>>Got it. Why not just do this:
>>         return unless $_[0] =~ /^Failed/i; #dont catch Test::ok failures
>>+        print $_[0];
> truthfully, I spent far too long trying to figure out why the die() wasn't
> cascading.  once I got it I just patched it and let the patch fly without
> too much afterthought.

> but yeah, I think that will work just fine.  is there any reason you can
> think of that we wouldn't want to see the error?  or if the error should
> sometimes be preceeded with '#'?

That error gets spit after has finished its parsing, so it doesn't 
matter whether there is # or not. In order to be consistent with non-A-T test 
suites I suggest that we do not add #.

I suppose the error wasn't printed because it may have been too big in some 
cases (if it was generated from some other place and not 
Test::Harness::_show_results(), so we may need to add a regex to only print 
the output of the latter. But since now I can't tell whether we need to do it 
or not, let's just print it and if in the future we find it to be a problem, 
we will add the regex to print only if it's the m|Failed x/x test scripts| 
match or match the caller. For example this does the trick:

Index: Apache-Test/lib/Apache/
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/,v
retrieving revision 1.166
diff -u -r1.166
--- Apache-Test/lib/Apache/   16 Apr 2004 20:29:23 -0000      1.166
+++ Apache-Test/lib/Apache/   5 May 2004 23:15:14 -0000
@@ -347,6 +347,7 @@

      $SIG{__DIE__} = sub {
          return unless $_[0] =~ /^Failed/i; #dont catch Test::ok failures
+        print $_[0] if (caller(1))[3]||'' eq 'Test::Harness::_show_results';
          $server->stop(1) if $opts->{'start-httpd'};
          $server->failed_msg("error running tests");
          exit_perl 0;

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message