test::harness::straps.3

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· 3 代码 · 共 301 行

3
301
字号
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  \*(C+ will.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el       .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "Test::Harness::Straps 3".TH Test::Harness::Straps 3 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"Test::Harness::Straps \- detailed analysis of test results.SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 1\&  use Test::Harness::Straps;\&\&  my $strap = Test::Harness::Straps\->new;\&\&  # Various ways to interpret a test\&  my $results = $strap\->analyze($name, \e@test_output);\&  my $results = $strap\->analyze_fh($name, $test_filehandle);\&  my $results = $strap\->analyze_file($test_file);\&\&  # UNIMPLEMENTED\&  my %total = $strap\->total_results;\&\&  # Altering the behavior of the strap  UNIMPLEMENTED\&  my $verbose_output = $strap\->dump_verbose();\&  $strap\->dump_verbose_fh($output_filehandle);.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"\&\fB\s-1THIS\s0 \s-1IS\s0 \s-1ALPHA\s0 \s-1SOFTWARE\s0\fR in that the interface is subject to changein incompatible ways.  It is otherwise stable..PPTest::Harness is limited to printing out its results.  This makesanalysis of the test results difficult for anything but a human.  Tomake it easier for programs to work with test results, we provideTest::Harness::Straps.  Instead of printing the results, strapsprovide them as raw data.  You can also configure how the tests are tobe run..PPThe interface is currently incomplete.  \fIPlease\fR contact the authorif you'd like a feature added or something change or just havecomments..SH "CONSTRUCTION".IX Header "CONSTRUCTION".Sh "\fInew()\fP".IX Subsection "new()".Vb 1\&  my $strap = Test::Harness::Straps\->new;.Ve.PPInitialize a new strap..PP.Vb 1\&  $strap\->_init;.Ve.PPInitialize the internal state of a strap to make it ready for parsing..SH "ANALYSIS".IX Header "ANALYSIS".ie n .Sh "$strap\fP\->analyze( \f(CW$name, \e@output_lines )".el .Sh "\f(CW$strap\fP\->analyze( \f(CW$name\fP, \e@output_lines )".IX Subsection "$strap->analyze( $name, @output_lines )".Vb 1\&    my $results = $strap\->analyze($name, \e@test_output);.Ve.PPAnalyzes the output of a single test, assigning it the given \f(CW$name\fRfor use in the total report.  Returns the \f(CW$results\fR of the test.See Results..PP\&\f(CW@test_output\fR should be the raw output from the test, includingnewlines..PP.Vb 1\&    my $results = $strap\->analyze_fh($name, $test_filehandle);.Ve.PPLike \f(CW\*(C`analyze\*(C'\fR, but it reads from the given filehandle..ie n .Sh "$strap\fP\->analyze_file( \f(CW$test_file )".el .Sh "\f(CW$strap\fP\->analyze_file( \f(CW$test_file\fP )".IX Subsection "$strap->analyze_file( $test_file )".Vb 1\&    my $results = $strap\->analyze_file($test_file);.Ve.PPLike \f(CW\*(C`analyze\*(C'\fR, but it runs the given \f(CW$test_file\fR and parses itsresults.  It will also use that name for the total report..PPReturns the full command line that will be run to test \fI\f(CI$file\fI\fR..PPReturns the command that runs the test.  Combine this with \f(CW\*(C`_switches()\*(C'\fRto build a command line..PPTypically this is \f(CW$^X\fR, but you can set \f(CW$ENV{HARNESS_PERL}\fRto use a different Perl than what you're running the harness under.This might be to run a threaded Perl, for example..PPYou can also overload this method if you've built your own strap subclass,such as a \s-1PHP\s0 interpreter for a PHP-based strap..PPFormats and returns the switches necessary to run the test..PPReturns only defined, non-blank, trimmed switches from the parms passed..PP.Vb 1\&  local $ENV{PERL5LIB} = $self\->_INC2PERL5LIB;.Ve.PPTakes the current value of \f(CW@INC\fR and turns it into something suitablefor putting onto \f(CW\*(C`PERL5LIB\*(C'\fR..PP.Vb 1\&  my @filtered_inc = $self\->_filtered_INC;.Ve.PPShortens \f(CW@INC\fR by removing redundant and unnecessary entries.Necessary for OSes with limited command line lengths, like \s-1VMS\s0..PP.Vb 1\&  $self\->_restore_PERL5LIB;.Ve.PPThis restores the original value of the \f(CW\*(C`PERL5LIB\*(C'\fR environment variable.Necessary on \s-1VMS\s0, otherwise a no-op..SH "Parsing".IX Header "Parsing"Methods for identifying what sort of line you're looking at..PP.Vb 1\&    my $is_diagnostic = $strap\->_is_diagnostic($line, \e$comment);.Ve.PPChecks if the given line is a comment.  If so, it will place it into\&\f(CW$comment\fR (sans #)..PP.Vb 1\&  my $is_header = $strap\->_is_header($line);.Ve.PPChecks if the given line is a header (1..M) line.  If so, it places howmany tests there will be in \f(CW\*(C`$strap\->{max}\*(C'\fR, a list of which testsare todo in \f(CW\*(C`$strap\->{todo}\*(C'\fR and if the whole test was skipped\&\f(CW\*(C`$strap\->{skip_all}\*(C'\fR contains the reason..PP.Vb 1\&  my $is_bail_out = $strap\->_is_bail_out($line, \e$reason);.Ve.PPChecks if the line is a \*(L"Bail out!\*(R".  Places the reason for bailing(if any) in \f(CW$reason\fR..PP.Vb 1\&  $strap\->_reset_file_state;.Ve.PPResets things like \f(CW\*(C`$strap\->{max}\*(C'\fR , \f(CW\*(C`$strap\->{skip_all}\*(C'\fR,etc. so it's ready to parse the next file..SH "EXAMPLES".IX Header "EXAMPLES"See \fIexamples/mini_harness.plx\fR for an example of use..SH "AUTHOR".IX Header "AUTHOR"Michael G Schwern \f(CW\*(C`<schwern at pobox.com>\*(C'\fR, currently maintained byAndy Lester \f(CW\*(C`<andy at petdance.com>\*(C'\fR..SH "SEE ALSO".IX Header "SEE ALSO"Test::Harness

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?