1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
4 .\" ========================================================================
5 .de Sh \" Subsection heading
13 .de Sp \" Vertical space (when we can't use .PP)
17 .de Vb \" Begin verbatim text
22 .de Ve \" End verbatim text
26 .\" Set up some character translations and predefined strings. \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote. | will give a
29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
57 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear. Run. Save yourself. No user-serviceable parts.
70 . \" fudge factors for nroff and troff
79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85 . \" simple accents for nroff and troff
95 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
102 . \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 . \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 . \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
129 .\" ========================================================================
131 .IX Title "TAP::Parser::Result 3"
132 .TH TAP::Parser::Result 3 "2009-05-05" "perl v5.8.7" "User Contributed Perl Documentation"
134 TAP::Parser::Result \- Base class for TAP::Parser output objects
139 .IX Header "SYNOPSIS"
141 \& # abstract class \- not meany to be used directly
142 \& # see TAP::Parser::ResultFactory for preferred usage
147 \& use TAP::Parser::Result;
148 \& my $token = {...};
149 \& my $result = TAP::Parser::Result\->new( $token );
151 .Sh "\s-1DESCRIPTION\s0"
152 .IX Subsection "DESCRIPTION"
153 This is a simple base class used by TAP::Parser to store objects that
154 represent the current bit of test output data from \s-1TAP\s0 (usually a single
155 line). Unless you're subclassing, you probably won't need to use this module
158 .IX Subsection "METHODS"
159 \fI\f(CI\*(C`new\*(C'\fI\fR
163 \& # see TAP::Parser::ResultFactory for preferred usage
167 \& # to use directly:
168 \& my $result = TAP::Parser::Result\->new($token);
171 Returns an instance the appropriate class for the test token passed in.
172 .Sh "Boolean methods"
173 .IX Subsection "Boolean methods"
174 The following methods all return a boolean value and are to be overridden in
175 the appropriate subclass.
176 .ie n .IP "* ""is_plan""" 4
177 .el .IP "* \f(CWis_plan\fR" 4
179 Indicates whether or not this is the test plan line.
184 .ie n .IP "* ""is_pragma""" 4
185 .el .IP "* \f(CWis_pragma\fR" 4
187 Indicates whether or not this is a pragma line.
192 .ie n .IP "* ""is_test""" 4
193 .el .IP "* \f(CWis_test\fR" 4
195 Indicates whether or not this is a test line.
200 .ie n .IP "* ""is_comment""" 4
201 .el .IP "* \f(CWis_comment\fR" 4
202 .IX Item "is_comment"
203 Indicates whether or not this is a comment.
206 \& # this is a comment
208 .ie n .IP "* ""is_bailout""" 4
209 .el .IP "* \f(CWis_bailout\fR" 4
210 .IX Item "is_bailout"
211 Indicates whether or not this is bailout line.
214 \& Bail out! We're out of dilithium crystals.
216 .ie n .IP "* ""is_version""" 4
217 .el .IP "* \f(CWis_version\fR" 4
218 .IX Item "is_version"
219 Indicates whether or not this is a \s-1TAP\s0 version line.
224 .ie n .IP "* ""is_unknown""" 4
225 .el .IP "* \f(CWis_unknown\fR" 4
226 .IX Item "is_unknown"
227 Indicates whether or not the current line could be parsed.
230 \& ... this line is junk ...
232 .ie n .IP "* ""is_yaml""" 4
233 .el .IP "* \f(CWis_yaml\fR" 4
235 Indicates whether or not this is a \s-1YAML\s0 chunk.
237 \fI\f(CI\*(C`raw\*(C'\fI\fR
241 \& print $result\->raw;
244 Returns the original line of text which was parsed.
246 \fI\f(CI\*(C`type\*(C'\fI\fR
247 .IX Subsection "type"
250 \& my $type = $result\->type;
253 Returns the \*(L"type\*(R" of a token, such as \f(CW\*(C`comment\*(C'\fR or \f(CW\*(C`test\*(C'\fR.
255 \fI\f(CI\*(C`as_string\*(C'\fI\fR
256 .IX Subsection "as_string"
259 \& print $result\->as_string;
262 Prints a string representation of the token. This might not be the exact
263 output, however. Tests will have test numbers added if not present, \s-1TODO\s0 and
264 \&\s-1SKIP\s0 directives will be capitalized and, in general, things will be cleaned
265 up. If you need the original text for the token, see the \f(CW\*(C`raw\*(C'\fR method.
267 \fI\f(CI\*(C`is_ok\*(C'\fI\fR
268 .IX Subsection "is_ok"
271 \& if ( $result\->is_ok ) { ... }
274 Reports whether or not a given result has passed. Anything which is \fBnot\fR a
275 test result returns true. This is merely provided as a convenient shortcut.
277 \fI\f(CI\*(C`passed\*(C'\fI\fR
278 .IX Subsection "passed"
280 Deprecated. Please use \f(CW\*(C`is_ok\*(C'\fR instead.
282 \fI\f(CI\*(C`has_directive\*(C'\fI\fR
283 .IX Subsection "has_directive"
286 \& if ( $result\->has_directive ) {
291 Indicates whether or not the given result has a \s-1TODO\s0 or \s-1SKIP\s0 directive.
293 \fI\f(CI\*(C`has_todo\*(C'\fI\fR
294 .IX Subsection "has_todo"
297 \& if ( $result\->has_todo ) {
302 Indicates whether or not the given result has a \s-1TODO\s0 directive.
304 \fI\f(CI\*(C`has_skip\*(C'\fI\fR
305 .IX Subsection "has_skip"
308 \& if ( $result\->has_skip ) {
313 Indicates whether or not the given result has a \s-1SKIP\s0 directive.
315 \fI\f(CI\*(C`set_directive\*(C'\fI\fR
316 .IX Subsection "set_directive"
318 Set the directive associated with this token. Used internally to fake
321 .IX Header "SUBCLASSING"
322 Please see \*(L"\s-1SUBCLASSING\s0\*(R" in TAP::Parser for a subclassing overview.
324 Remember: if you want your subclass to be automatically used by the parser,
325 you'll have to register it with \*(L"register_type\*(R" in TAP::Parser::ResultFactory.
327 If you're creating a completely new result \fItype\fR, you'll probably need to
328 subclass TAP::Parser::Grammar too, or else it'll never get used.
330 .IX Subsection "Example"
341 \& @ISA = 'TAP::Parser::Result';
345 \& # register with the factory:
346 \& TAP::Parser::ResultFactory\->register_type( 'my_type' => __PACKAGE__ );
350 \& sub as_string { 'My results all look the same' }
353 .IX Header "SEE ALSO"
356 TAP::Parser::ResultFactory,
357 TAP::Parser::Result::Bailout,
358 TAP::Parser::Result::Comment,
359 TAP::Parser::Result::Plan,
360 TAP::Parser::Result::Pragma,
361 TAP::Parser::Result::Test,
362 TAP::Parser::Result::Unknown,
363 TAP::Parser::Result::Version,
364 TAP::Parser::Result::YAML,