📄 apache::testmb.3
字号:
.\" 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 "Apache::TestMB 3".TH Apache::TestMB 3 "2005-10-21" "perl v5.10.0" "User Contributed Perl Documentation".\" 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"Apache::TestMB \- Subclass of Module::Build to support Apache::Test.SH "SYNOPSIS".IX Header "SYNOPSIS"Standard process for building & installing modules:.PP.Vb 4\& perl Build.PL\& ./Build\& ./Build test\& ./Build install.Ve.PPOr, if you're on a platform (like \s-1DOS\s0 or Windows) that doesn't like the \*(L"./\*(R"notation, you can do this:.PP.Vb 4\& perl Build.PL\& perl Build\& perl Build test\& perl Build install.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"This class subclasses \f(CW\*(C`Module::Build\*(C'\fR to add support for testingApache integration with Apache::Test. It is broadly based on\&\f(CW\*(C`Apache::TestMM\*(C'\fR, and as such adds a number of build actions to a the\&\fIBuild\fR script, while simplifying the process of creating \fIBuild.PL\fRscripts..PPHere's how to use \f(CW\*(C`Apache::TestMB\*(C'\fR in a \fIBuild.PL\fR script:.PP.Vb 1\& use Module::Build;\&\& my $build_pkg = eval { require Apache::TestMB }\& ? \*(AqApache::TestMB\*(Aq : \*(AqModule::Build\*(Aq;\&\& my $build = $build_pkg\->new(\& module_name => \*(AqMy::Module\*(Aq,\& );\& $build\->create_build_script;.Ve.PPThis is identical to how \f(CW\*(C`Module::Build\*(C'\fR is used. Not all targetsystems may have \f(CW\*(C`Apache::Test\*(C'\fR (and therefore \f(CW\*(C`Apache::TestMB\*(C'\fRinstalled, so we test for it to be installed, first. But otherwise,its use can be exactly the same. Consult theModule::Build documentation for more information onhow to use it; Module::Build::Cookbook maybe especially useful for those looking to migrate from\&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR..SH "INTERFACE".IX Header "INTERFACE".Sh "Build".IX Subsection "Build"With the above script, users can build your module in the usual\&\f(CW\*(C`Module::Build\*(C'\fR way:.PP.Vb 4\& perl Build.PL\& ./Build\& ./Build test\& ./Build install.Ve.PPIf \f(CW\*(C`Apache::TestMB\*(C'\fR is installed, then Apache will be started beforetests are run by the \f(CW\*(C`test\*(C'\fR action, and shut down when the testscomplete. Note that \f(CW\*(C`Build.PL\*(C'\fR can be called \f(CW\*(C`Apache::Test\*(C'\fR\-specificoptions in addition to the usual \f(CW\*(C`Module::Build\*(C'\fR options. Forexample:.PP.Vb 1\& perl Build.PL \-apxs=/usr/local/apache/bin/apxs.Ve.PPConsult the Apache::Test documentation for a completelist of options..PPIn addition to the actions provided by \f(CW\*(C`Module::Build\*(C'\fR (\f(CW\*(C`build\*(C'\fR,\&\f(CW\*(C`clean\*(C'\fR, \f(CW\*(C`code\*(C'\fR, \f(CW\*(C`test\*(C'\fR, etc.), \f(CW\*(C`Apache::TestMB\*(C'\fR adds a few extraactions:.IP "test_clean" 4.IX Item "test_clean"This action cleans out the files generated by the test script,\&\fIt/TEST\fR. It is also executed by the \f(CW\*(C`clean\*(C'\fR action..IP "run_tests" 4.IX Item "run_tests"This action actually the tests by executing the test script,\&\fIt/TEST\fR. It is executed by the \f(CW\*(C`test\*(C'\fR action, so most of the timeit won't be executed directly..IP "testcover" 4.IX Item "testcover"\&\f(CW\*(C`Apache::TestMB\*(C'\fR overrides this action from \f(CW\*(C`Module::Build\*(C'\fR in order toprevent the \f(CW\*(C`Apache::Test\*(C'\fR preference files from being included in the testcoverage..Sh "Constructor".IX Subsection "Constructor"\fInew\fR.IX Subsection "new".PPThe \f(CW\*(C`new()\*(C'\fR constructor takes all the same arguments as its parent in\&\f(CW\*(C`Module::Build\*(C'\fR, but can optionally accept one other parameter:.IP "apache_test_script" 4.IX Item "apache_test_script"The name of the \f(CW\*(C`Apache::Test\*(C'\fR test script. The default value is\&\fIt/TEST\fR, which will work in the vast majority of cases. If you wishto specify your own file name, do so with a relative file name usingUnix-style paths; the file name will automatically be converted forthe local platform..PPWhen \f(CW\*(C`new()\*(C'\fR is called it does the following:.IP "\(bu" 4Processes the \f(CW\*(C`Apache::Test\*(C'\fR\-specific options in \f(CW@ARGV\fR. See theApache::Test documentation for a complete list ofoptions..IP "\(bu" 4Sets the name of the \f(CW\*(C`Apache::Test\*(C'\fR test script to \fIt/TEST\fR, unlessit was explicitly specified by the \f(CW\*(C`apache_test_script\*(C'\fR parameter..IP "\(bu" 4Calls \f(CW\*(C`generate_script()\*(C'\fR to generate \f(CW\*(C`Apache::Test\*(C'\fR test script,usually \fIt/TEST\fR..Sh "Instance Methods".IX Subsection "Instance Methods"\fIapache_test_args\fR.IX Subsection "apache_test_args".PPReturns a hash reference containing all of the settings specified byoptions passed to \fIBuild.PL\fR, or explicitly added to \f(CW@ARGV\fR in\&\fIBuild.PL\fR. Consult the Apache::Test documentationfor a complete list of options..PP\fIapache_test_script\fR.IX Subsection "apache_test_script".PPGets or sets the file name of the \f(CW\*(C`Apache::Test\*(C'\fR test script..PP\fIgenerate_script\fR.IX Subsection "generate_script".PP.Vb 3\& $build\->generate_script;\& $build\->generate_script(\*(Aqt/FOO\*(Aq);\& $build\->generate_script(undef, \*(AqApache::TestRun\*(Aq);.Ve.PPThis method is called by \f(CW\*(C`new()\*(C'\fR, so in most cases it can beignored. If you'd like it to use other than the default arguments, youcan call it explicitly in \fIBuild.PL\fR and pass it the arguments youdesire. It takes two optional arguments:.IP "\(bu" 4The name of the \f(CW\*(C`Apache::Test\*(C'\fR test script. Defaults to the valuereturned by \f(CW\*(C`apache_test_script()\*(C'\fR..IP "\(bu" 4The name of an \f(CW\*(C`Apache::Test\*(C'\fR test running class. Defaults to\&\f(CW\*(C`Apache::TestRunPerl\*(C'\fR..PPIf there is an existing \fIt/TEST.PL\fR (or a script with the same nameas specified by the \f(CW\*(C`apache_test_script\*(C'\fR parameter but with \fI.PL\fRappended to it), then that script will be used as the template for thetest script. Otherwise, a simple test script will be written similarto what would be written by \f(CW\*(C`Apache::TestRun::generate_script()\*(C'\fR(although that function is not aware of the arguments passed to\&\fIBuild.PL\fR, so use this one instead!)..SH "SEE ALSO".IX Header "SEE ALSO".IP "Apache::TestRequest" 4.IX Item "Apache::TestRequest"Demonstrates how to write tests to send requests to the Apache serverrun by \f(CW\*(C`./Build test\*(C'\fR..IP "Module::Build" 4.IX Item "Module::Build"The parent class for \f(CW\*(C`Apache::TestMB\*(C'\fR; consult it's documentation formore on its interface..IP "<http://www.perl.com/pub/a/2003/05/22/testing.html>" 4.IX Item "<http://www.perl.com/pub/a/2003/05/22/testing.html>"This article by Geoffrey Young explains how to configure Apache andwrite tests for your module using Apache::Test. Just use\&\f(CW\*(C`Apache::TestMB\*(C'\fR instead of \f(CW\*(C`Apache::TestMM\*(C'\fR to update it for usewith \f(CW\*(C`Module::Build\*(C'\fR..SH "AUTHOR".IX Header "AUTHOR"David Wheeler.PPQuestions can be asked at the test-dev <at> httpd.apache.org list. Formore information see: \fIhttp://httpd.apache.org/test/\fR and\&\fIhttp://perl.apache.org/docs/general/testing/testing.html\fR.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -