📄 apache::testrun.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::TestRun 3".TH Apache::TestRun 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::TestRun \- Run the test suite.SH "SYNOPSIS".IX Header "SYNOPSIS".SH "DESCRIPTION".IX Header "DESCRIPTION"The \f(CW\*(C`Apache::TestRun\*(C'\fR package controls the configuration and runningof the test suite..SH "METHODS".IX Header "METHODS"Several methods are sub-classable, if the default behavior should bechanged..ie n .Sh """bug_report""".el .Sh "\f(CWbug_report\fP".IX Subsection "bug_report"The \f(CW\*(C`bug_report()\*(C'\fR method is executed when \f(CW\*(C`t/TEST\*(C'\fR was executedwith the \f(CW\*(C`\-bugreport\*(C'\fR option, and \f(CW\*(C`make test\*(C'\fR (or \f(CW\*(C`t/TEST\*(C'\fR)fail. Normally this is callback which you can use to tell the user howto deal with the problem, e.g. suggesting to read some document oremail some details to someone who can take care of it. By defaultnothing is executed..PPThe \f(CW\*(C`\-bugreport\*(C'\fR option is needed so this feature won't becomeannoying to developers themselves. It's automatically added to the\&\f(CW\*(C`run_tests\*(C'\fR target in \fIMakefile\fR. So if you repeateadly have to testyour code, just don't use \f(CW\*(C`make test\*(C'\fR but run \f(CW\*(C`t/TEST\*(C'\fRdirectly. Here is an example of a custom \f(CW\*(C`t/TEST\*(C'\fR.PP.Vb 1\& My::TestRun\->new\->run(@ARGV);\& \& package My::TestRun;\& use base \*(AqApache::TestRun\*(Aq;\&\& sub bug_report {\& my $self = shift;\& \& print <<EOI;\& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\& | Please file a bug report: http://perl.apache.org/bugs/ |\& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\& EOI\& }.Ve.ie n .Sh """pre_configure""".el .Sh "\f(CWpre_configure\fP".IX Subsection "pre_configure"The \f(CW\*(C`pre_configure()\*(C'\fR method is executed before the configuration for\&\f(CW\*(C`Apache::Test\*(C'\fR is generated. So if you need to adjust the setupbefore \fIhttpd.conf\fR and other files are autogenerated, this is theright place to do so..PPFor example if you don't want to inherit a LoadModule directive for\&\fImod_apreq.so\fR but to make sure that the local version is used, youcan sub-class \f(CW\*(C`Apache::TestRun\*(C'\fR and override this method in\&\fIt/TEST.PL\fR:.PP.Vb 4\& package My::TestRun;\& use base \*(AqApache::TestRun\*(Aq;\& use Apache::TestConfig;\& _\|_PACKAGE_\|_\->new\->run(@ARGV);\& \& sub pre_configure {\& my $self = shift;\& # Don\*(Aqt load an installed mod_apreq\& Apache::TestConfig::autoconfig_skip_module_add(\*(Aqmod_apreq.c\*(Aq);\& \& $self\->SUPER::pre_configure();\& }.Ve.PPNotice that the extension is \fI.c\fR, and not \fI.so\fR..PPDon't forget to run the super class' c<\fIpre_configure()\fR> method..ie n .Sh """new_test_config""".el .Sh "\f(CWnew_test_config\fP".IX Subsection "new_test_config"\&\s-1META:\s0 to be completed.SH "Persistent Custom Configuration".IX Header "Persistent Custom Configuration"When \f(CW\*(C`Apache::Test\*(C'\fR is first installed or used, it will save thevalues of \f(CW\*(C`httpd\*(C'\fR, \f(CW\*(C`apxs\*(C'\fR, \f(CW\*(C`port\*(C'\fR, \f(CW\*(C`user\*(C'\fR, and \f(CW\*(C`group\*(C'\fR, if set,to a configuration file \f(CW\*(C`Apache::TestConfigData\*(C'\fR. This informationwill then be used in setting these options for subsequent uses of\&\f(CW\*(C`Apache\-Test\*(C'\fR unless temprorarily overridden, either by setting theappropriate environment variable (\f(CW\*(C`APACHE_TEST_HTTPD\*(C'\fR,\&\f(CW\*(C`APACHE_TEST_APXS\*(C'\fR, \f(CW\*(C`APACHE_TEST_PORT\*(C'\fR, \f(CW\*(C`APACHE_TEST_USER\*(C'\fR, and\&\f(CW\*(C`APACHE_TEST_GROUP\*(C'\fR) or by giving the relevant option (\f(CW\*(C`\-httpd\*(C'\fR,\&\f(CW\*(C`\-apxs\*(C'\fR, \f(CW\*(C`\-port\*(C'\fR, \f(CW\*(C`\-user\*(C'\fR, and \f(CW\*(C`\-group\*(C'\fR) when the \f(CW\*(C`TEST\*(C'\fR scriptis run..PPTo avoid either using previous persistent configurations or savingcurrent configurations, set the \f(CW\*(C`APACHE_TEST_NO_STICKY_PREFERENCES\*(C'\fRenvironment variable to a true value..PPFinally it's possible to permanently override the previously savedoptions by passing \f(CW\*(C`\-save\*(C'\fR..PPHere is the algorithm of how and when options are saved for the firsttime and when they are used. We will use a few variables to simplifythe pseudo\-code/pseudo\-chart flow:.PP\&\f(CW$config_exists\fR \- custom configuration has already been saved, toget this setting run \f(CW\*(C`custom_config_exists()\*(C'\fR, which tests whethereither \f(CW\*(C`apxs\*(C'\fR or \f(CW\*(C`httpd\*(C'\fR values are set. It doesn't check for othervalues, since all we need is \f(CW\*(C`apxs\*(C'\fR or \f(CW\*(C`httpd\*(C'\fR to get the test suiterunning. \fIcustom_config_exists()\fR checks in the following order\&\fIlib/Apache/TestConfigData.pm\fR (if during Apache-Test build) ,\&\fI~/.apache\-test/Apache/TestConfigData.pm\fR and\&\fIApache/TestConfigData.pm\fR in the perl's libraries..PP\&\f(CW$config_overriden\fR \- that means that we have either \f(CW\*(C`apxs\*(C'\fR or\&\f(CW\*(C`httpd\*(C'\fR values provided by user, via env vars or command line options..IP "1 Building Apache-Test or modperl\-2.0 (or any other project that bundles Apache-Test)." 4.IX Item "1 Building Apache-Test or modperl-2.0 (or any other project that bundles Apache-Test).".Vb 2\& 1) perl Apache\-Test/Makefile.PL\& (for bundles top\-level Makefile.PL will run this as well)\&\& if $config_exists\& do nothing\& else\& create lib/Apache/TestConfigData.pm w/ empty config: {}\&\& 2) make\&\& 3) make test\&\& if $config_exists\& if $config_overriden\& override saved options (for those that were overriden)\& else\& use saved options\& else\& if $config_overriden\& save them in lib/Apache/TestConfigData.pm\& (which will be installed on \*(Aqmake install\*(Aq)\& else\& \- run interactive prompt for C<httpd> and optionally for C<apxs>\& \- save the custom config in lib/Apache/TestConfigData.pm\& \- restart the currently run program\&\& modperl\-2.0 is a special case in (3). it always overrides \*(Aqhttpd\*(Aq\& and \*(Aqapxs\*(Aq settings. Other settings like \*(Aqport\*(Aq, can be used from\& the saved config.\&\& 4) make install\&\& if $config_exists only in lib/Apache/TestConfigData.pm\& it will be installed system\-wide\& else\& nothing changes (since lib/Apache/TestConfigData.pm won\*(Aqt exist).Ve.IP "2 Testing 3rd party modules (after Apache-Test was installed)" 4.IX Item "2 Testing 3rd party modules (after Apache-Test was installed)"Notice that the following situation is quite possible:.Sp.Vb 2\& cd Apache\-Test\& perl Makefile.PL && make install.Ve.Spso that Apache-Test was installed but no custom configuration saved(since its \f(CW\*(C`make test\*(C'\fR wasn't run). In which case the interactiveconfiguration should kick in (unless config options were passed) andin any case saved once configured..Sp\&\f(CW$custom_config_path\fR \- perl's \fIApache/TestConfigData.pm\fR (at thesame location as \fIApache/TestConfig.pm\fR) if that area is writable bythat user (e.g. perl's lib is not owned by 'root'). If not, in\&\fI~/.apache\-test/Apache/TestConfigData.pm\fR..Sp.Vb 3\& 1) perl Apache\-Test/Makefile.PL\& 2) make\& 3) make test\&\& if $config_exists\& if $config_overriden\& override saved options (for those that were overriden)\& else\& use saved options\& else\& if $config_overriden\& save them in $custom_config_path\& else\& \- run interactive prompt for C<httpd> and optionally for C<apxs>\& \- save the custom config in $custom_config_path\& \- restart the currently run program\&\& 4) make install.Ve.Sh "Saving Custom Configuration Options".IX Subsection "Saving Custom Configuration Options"If you want to override the existing custom configurations options to\&\f(CW\*(C`Apache::TestConfigData\*(C'\fR, use the \f(CW\*(C`\-save\*(C'\fR flag when running \f(CW\*(C`TEST\*(C'\fR..PPIf you are running \f(CW\*(C`Apache::Test\*(C'\fR as a user who does not havepermission to alter the system \f(CW\*(C`Apache::TestConfigData\*(C'\fR, you canplace your own private configuration file \fITestConfigData.pm\fR under\&\f(CW\*(C`$ENV{HOME}/.apache\-test/Apache/\*(C'\fR, which \f(CW\*(C`Apache::Test\*(C'\fR will use, ifpresent. An example of such a configuration file is.PP.Vb 5\& # file $ENV{HOME}/.apache\-test/Apache/TestConfigData.pm\& package Apache::TestConfigData;\& use strict;\& use warnings;\& use vars qw($vars);\&\& $vars = {\& \*(Aqgroup\*(Aq => \*(Aqme\*(Aq,\& \*(Aquser\*(Aq => \*(Aqmyself\*(Aq,\& \*(Aqport\*(Aq => \*(Aq8529\*(Aq,\& \*(Aqhttpd\*(Aq => \*(Aq/usr/local/apache/bin/httpd\*(Aq,\&\& };\& 1;.Ve
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -