httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache Test.pm
Date Wed, 13 Aug 2003 22:00:25 GMT
stas        2003/08/13 15:00:25

  Modified:    perl-framework/Apache-Test/lib/Apache Test.pm
  Log:
  trick ok() into reporting the caller filename/line when a
  sub-test fails in sok()
  
  Revision  Changes    Path
  1.67      +8 -1      httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm
  
  Index: Test.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- Test.pm	5 Aug 2003 18:49:43 -0000	1.66
  +++ Test.pm	13 Aug 2003 22:00:25 -0000	1.67
  @@ -46,7 +46,14 @@
           return;
       }
   
  -    ok $sub->();
  +    my($package, $filename, $line) = caller;
  +
  +    # trick ok() into reporting the caller filename/line when a
  +    # sub-test fails in sok()
  +    return eval <<EOE;
  +#line $line $filename
  +    ok(\$sub->());
  +EOE
   }
   
   #so Perl's Test.pm can be run inside mod_perl
  
  
  

Mime
View raw message