- CLASS METHODS
- UTILITY METHODS
- CALCULATED BOOLEAN ATTRIBUTES
- BOOLEAN ATTRIBUTES
Test::Builder::Trace::Frame - Module to represent a stack frame
When a test fails it will report the filename and line where the failure occured . In order to do this it needs to look at the stack and figure out where your tests stop, and the tools you are using begin . This object represents a single stack frame .
- $frame = $class->new($depth, $package, $file, $line, $sub)
Create a new instance.
my $frame = $class->new(4, caller(4));
- @call = $frame->call
- ($pkg, $file, $line, $subname) = $frame->call
Returns a list similar to calling
- $depth = $frame->depth
Depth of the frame in the stack
- $package = $frame->package
Package of the frame
- $file = $frame->file
File of the frame
- $line = $frame->line
Line of the frame
- $subname = $frame->subname
Name of sub being called
- $attrs = $frame->provider_tool
If the frame is a call to a provider tool this will contain the attribute hashref for that tool. This returns undef when the call was not to a provider tool.
The state of these booleans will be determined the first time they are called. They will be cached for future calls.
- $todo = $frame->todo
True if the frame comes from a package where $TODO is present.
Caveat Will not find the $TODO if it is undefined UNLESS the $TODO came from Test::More.
- $bool = $frame->nest
True if the frame is a call to Test::Builder::Trace::nest().
- $bool = $frame->builder
True if the frame is inside Test::Builder code.
- $bool = $frame->transition
True if the frame is a transition between Test::Builder and Non-Test::Builder code.
- $bool = $frame->anointed
True if the frame is a call from an annointed test package.
Note None of these are set automatically by the constructor or any other calls. These get set by Test::Builder::Trace when it scans the stack. It will never be useful to check these on a frame object you created yourself.
- $bool = $frame->level
True if the frame is associated with
- $bool = $frame->report
True if the frame has been chosen as the reporting frame.
Copyright 2014 by Chad Granum <firstname.lastname@example.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.