* chromatic <[EMAIL PROTECTED]> [2006-07-20 01:25]:
> On Wednesday 19 July 2006 10:35, Fergal Daly wrote:
> > It's already done! Test::Builder already knows how to find
> > where the user script jumps into Test::XXX land. All I'm
> > saying is that instead of just outputting that 1 frame,
> > output all the frame from there on up (in this case 2).
> > Neither magic nor rocket science.
>
> Do you *really* want to force everyone, everywhere to name
> their test modules Test::*, name none of their
> Test::Class-based tests anything starting with Test::, and wade
> through call stack output on every failure?
No, I think that’s not what Fergal means. While he is being
obtuse, let me be explicit:
The $Level variable lets T::B know which stack frame to use as
the apparent source of the failure. But T::B could also print all
the stack frames closer to the user code. So if you have a call
stack like this:
t/02-foo.t line 192
t/02-foo.t line 82
t/Test/Foo.pm line 26
$inc[$n]/Test/WhizBang.pm line 42
$inc[$n]/Test/Frobnitz.pm line 37
$inc[$n]/Test/More.pm line 96
$inc[$n]/Test/Builder.pm line 221
and the subroutines in ::WhizBang, ::Frobnitz and ::More all do
the local $Level bit, then instead of just
t/Test/Foo.pm line 26
being pointed out as the source of the failure, it would be
t/02-foo.t line 192
t/02-foo.t line 82
t/Test/Foo.pm line 26
Fergal is right: that is useful and 100% reliable – and only the
Test::Foo authors need to do the local $Level bit.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>