.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" 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. | will give a .\" real vertical bar. \*(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-|\(bv\*(Tr .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\} .\" .\" 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. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" 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 "PROVE 1" .TH PROVE 1 "2010-01-30" "perl v5.8.4" "User Contributed Perl Documentation" .SH "NAME" prove \- Run tests through a TAP harness. .SH "USAGE" .IX Header "USAGE" .Vb 1 \& prove [options] [files or directories] .Ve .SH "OPTIONS" .IX Header "OPTIONS" Boolean options: .PP .Vb 32 \& -v, --verbose Print all test lines. \& -l, --lib Add 'lib' to the path for your tests (-Ilib). \& -b, --blib Add 'blib/lib' and 'blib/arch' to the path for \& your tests \& -s, --shuffle Run the tests in random order. \& -c, --color Colored test output (default). \& --nocolor Do not color test output. \& --count Show the X/Y test count when not verbose \& (default) \& --nocount Disable the X/Y test count. \& -D --dry Dry run. Show test that would have run. \& --ext Set the extension for tests (default '.t') \& -f, --failures Show failed tests. \& -o, --comments Show comments. \& --ignore-exit Ignore exit status from test scripts. \& -m, --merge Merge test scripts' STDERR with their STDOUT. \& -r, --recurse Recursively descend into directories. \& --reverse Run the tests in reverse order. \& -q, --quiet Suppress some test output while running tests. \& -Q, --QUIET Only print summary results. \& -p, --parse Show full list of TAP parse errors, if any. \& --directives Only show results with TODO or SKIP directives. \& --timer Print elapsed time after each test. \& --normalize Normalize TAP output in verbose output \& -T Enable tainting checks. \& -t Enable tainting warnings. \& -W Enable fatal warnings. \& -w Enable warnings. \& -h, --help Display this help \& -?, Display this help \& -H, --man Longer manpage for prove \& --norc Don't process default .proverc .Ve .PP Options that take arguments: .PP .Vb 13 \& -I Library paths to include. \& -P Load plugin (searches App::Prove::Plugin::*.) \& -M Load a module. \& -e, --exec Interpreter to run the tests ('' for compiled \& tests.) \& --harness Define test harness to use. See TAP::Harness. \& --formatter Result formatter to use. See FORMATTERS. \& --source Load and/or configure a SourceHandler. See \& SOURCE HANDLERS. \& -a, --archive out.tgz Store the resulting TAP in an archive file. \& -j, --jobs N Run N test jobs in parallel (try 9.) \& --state=opts Control prove's persistent state. \& --rc=rcfile Process options from rcfile .Ve .SH "NOTES" .IX Header "NOTES" .Sh ".proverc" .IX Subsection ".proverc" If \fI~/.proverc\fR or \fI./.proverc\fR exist they will be read and any options they contain processed before the command line options. Options in \fI.proverc\fR are specified in the same way as command line options: .PP .Vb 3 \& # .proverc \& --state=hot,fast,save \& -j9 .Ve .PP Additional option files may be specified with the \f(CW\*(C`\-\-rc\*(C'\fR option. Default option file processing is disabled by the \f(CW\*(C`\-\-norc\*(C'\fR option. .PP Under Windows and \s-1VMS\s0 the option file is named \fI_proverc\fR rather than \&\fI.proverc\fR and is sought only in the current directory. .ie n .Sh "Reading from ""STDIN""" .el .Sh "Reading from \f(CWSTDIN\fP" .IX Subsection "Reading from STDIN" If you have a list of tests (or URLs, or anything else you want to test) in a file, you can add them to your tests by using a '\-': .PP .Vb 1 \& prove - < my_list_of_things_to_test.txt .Ve .PP See the \f(CW\*(C`README\*(C'\fR in the \f(CW\*(C`examples\*(C'\fR directory of this distribution. .Sh "Default Test Directory" .IX Subsection "Default Test Directory" If no files or directories are supplied, \f(CW\*(C`prove\*(C'\fR looks for all files matching the pattern \f(CW\*(C`t/*.t\*(C'\fR. .Sh "Colored Test Output" .IX Subsection "Colored Test Output" Colored test output is the default, but if output is not to a terminal, color is disabled. You can override this by adding the \&\f(CW\*(C`\-\-color\*(C'\fR switch. .PP Color support requires Term::ANSIColor on Unix-like platforms and Win32::Console windows. If the necessary module is not installed colored output will not be available. .Sh "Exit Code" .IX Subsection "Exit Code" If the tests fail \f(CW\*(C`prove\*(C'\fR will exit with non-zero status. .Sh "Arguments to Tests" .IX Subsection "Arguments to Tests" It is possible to supply arguments to tests. To do so separate them from prove's own arguments with the arisdottle, '::'. For example .PP .Vb 1 \& prove -v t/mytest.t :: --url http://example.com .Ve .PP would run \fIt/mytest.t\fR with the options '\-\-url http://example.com'. When running multiple tests they will each receive the same arguments. .ie n .Sh """\-\-exec""" .el .Sh "\f(CW\-\-exec\fP" .IX Subsection "--exec" Normally you can just pass a list of Perl tests and the harness will know how to execute them. However, if your tests are not written in Perl or if you want all tests invoked exactly the same way, use the \f(CW\*(C`\-e\*(C'\fR, or \f(CW\*(C`\-\-exec\*(C'\fR switch: .PP .Vb 3 \& prove --exec '/usr/bin/ruby -w' t/ \& prove --exec '/usr/bin/perl -Tw -mstrict -Ilib' t/ \& prove --exec '/path/to/my/customer/exec' .Ve .ie n .Sh """\-\-merge""" .el .Sh "\f(CW\-\-merge\fP" .IX Subsection "--merge" If you need to make sure your diagnostics are displayed in the correct order relative to test results you can use the \f(CW\*(C`\-\-merge\*(C'\fR option to merge the test scripts' \s-1STDERR\s0 into their \s-1STDOUT\s0. .PP This guarantees that \s-1STDOUT\s0 (where the test results appear) and \s-1STDOUT\s0 (where the diagnostics appear) will stay in sync. The harness will display any diagnostics your tests emit on \s-1STDERR\s0. .PP Caveat: this is a bit of a kludge. In particular note that if anything that appears on \s-1STDERR\s0 looks like a test result the test harness will get confused. Use this option only if you understand the consequences and can live with the risk. .ie n .Sh """\-\-state""" .el .Sh "\f(CW\-\-state\fP" .IX Subsection "--state" You can ask \f(CW\*(C`prove\*(C'\fR to remember the state of previous test runs and select and/or order the tests to be run based on that saved state. .PP The \f(CW\*(C`\-\-state\*(C'\fR switch requires an argument which must be a comma separated list of one or more of the following options. .ie n .IP """last""" 4 .el .IP "\f(CWlast\fR" 4 .IX Item "last" Run the same tests as the last time the state was saved. This makes it possible, for example, to recreate the ordering of a shuffled test. .Sp .Vb 2 \& # Run all tests in random order \& $ prove -b --state=save --shuffle .Ve .Sp .Vb 2 \& # Run them again in the same order \& $ prove -b --state=last .Ve .ie n .IP """failed""" 4 .el .IP "\f(CWfailed\fR" 4 .IX Item "failed" Run only the tests that failed on the last run. .Sp .Vb 2 \& # Run all tests \& $ prove -b --state=save .Ve .Sp .Vb 2 \& # Run failures \& $ prove -b --state=failed .Ve .Sp If you also specify the \f(CW\*(C`save\*(C'\fR option newly passing tests will be excluded from subsequent runs. .Sp .Vb 2 \& # Repeat until no more failures \& $ prove -b --state=failed,save .Ve .ie n .IP """passed""" 4 .el .IP "\f(CWpassed\fR" 4 .IX Item "passed" Run only the passed tests from last time. Useful to make sure that no new problems have been introduced. .ie n .IP """all""" 4 .el .IP "\f(CWall\fR" 4 .IX Item "all" Run all tests in normal order. Multple options may be specified, so to run all tests with the failures from last time first: .Sp .Vb 1 \& $ prove -b --state=failed,all,save .Ve .ie n .IP """hot""" 4 .el .IP "\f(CWhot\fR" 4 .IX Item "hot" Run the tests that most recently failed first. The last failure time of each test is stored. The \f(CW\*(C`hot\*(C'\fR option causes tests to be run in most\-recent\- failure order. .Sp .Vb 1 \& $ prove -b --state=hot,save .Ve .Sp Tests that have never failed will not be selected. To run all tests with the most recently failed first use .Sp .Vb 1 \& $ prove -b --state=hot,all,save .Ve .Sp This combination of options may also be specified thus .Sp .Vb 1 \& $ prove -b --state=adrian .Ve .ie n .IP """todo""" 4 .el .IP "\f(CWtodo\fR" 4 .IX Item "todo" Run any tests with todos. .ie n .IP """slow""" 4 .el .IP "\f(CWslow\fR" 4 .IX Item "slow" Run the tests in slowest to fastest order. This is useful in conjunction with the \f(CW\*(C`\-j\*(C'\fR parallel testing switch to ensure that your slowest tests start running first. .Sp .Vb 1 \& $ prove -b --state=slow -j9 .Ve .ie n .IP """fast""" 4 .el .IP "\f(CWfast\fR" 4 .IX Item "fast" Run test tests in fastest to slowest order. .ie n .IP """new""" 4 .el .IP "\f(CWnew\fR" 4 .IX Item "new" Run the tests in newest to oldest order based on the modification times of the test scripts. .ie n .IP """old""" 4 .el .IP "\f(CWold\fR" 4 .IX Item "old" Run the tests in oldest to newest order. .ie n .IP """fresh""" 4 .el .IP "\f(CWfresh\fR" 4 .IX Item "fresh" Run those test scripts that have been modified since the last test run. .ie n .IP """save""" 4 .el .IP "\f(CWsave\fR" 4 .IX Item "save" Save the state on exit. The state is stored in a file called \fI.prove\fR (\fI_prove\fR on Windows and \s-1VMS\s0) in the current directory. .PP The \f(CW\*(C`\-\-state\*(C'\fR switch may be used more than once. .PP .Vb 1 \& $ prove -b --state=hot --state=all,save .Ve .Sh "@INC" .IX Subsection "@INC" prove introduces a separation between \*(L"options passed to the perl which runs prove\*(R" and \*(L"options passed to the perl which runs tests\*(R"; this distinction is by design. Thus the perl which is running a test starts with the default \f(CW@INC\fR. Additional library directories can be added via the \f(CW\*(C`PERL5LIB\*(C'\fR environment variable, via \-Ifoo in \f(CW\*(C`PERL5OPT\*(C'\fR or via the \f(CW\*(C`\-Ilib\*(C'\fR option to \fIprove\fR. .Sh "Taint Mode" .IX Subsection "Taint Mode" Normally when a Perl program is run in taint mode the contents of the \&\f(CW\*(C`PERL5LIB\*(C'\fR environment variable do not appear in \f(CW@INC\fR. .PP Because \f(CW\*(C`PERL5LIB\*(C'\fR is often used during testing to add build directories to \f(CW@INC\fR prove passes the names of any directories found in \f(CW\*(C`PERL5LIB\*(C'\fR as \-I switches. The net effect of this is that \&\f(CW\*(C`PERL5LIB\*(C'\fR is honoured even when prove is run in taint mode. .SH "FORMATTERS" .IX Header "FORMATTERS" You can load a custom TAP::Parser::Formatter: .PP .Vb 1 \& prove --formatter MyFormatter .Ve .SH "SOURCE HANDLERS" .IX Header "SOURCE HANDLERS" You can load custom TAP::Parser::SourceHandlers, to change the way the parser interprets particular \fIsources\fR of \s-1TAP\s0. .PP .Vb 1 \& prove --source MyHandler --source YetAnother t .Ve .PP If you want to provide config to the source you can use: .PP .Vb 3 \& prove --source MyCustom \e \& --source Perl --perl-option 'foo=bar baz' --perl-option avg=0.278 \e \& --source File --file-option extensions=.txt --file-option extensions=.tmp t .Ve .PP Each \f(CW\*(C`\-\-$source\-option\*(C'\fR option must specify a key/value pair separated by an \&\f(CW\*(C`=\*(C'\fR. If an option can take multiple values, just specify it multiple times, as with the \f(CW\*(C`extensions=\*(C'\fR examples above. .PP All \f(CW\*(C`\-\-sources\*(C'\fR are combined into a hash, and passed to \*(L"new\*(R" in TAP::Harness's \&\f(CW\*(C`sources\*(C'\fR parameter. .PP See TAP::Parser::IteratorFactory for more details on how configuration is passed to \fISourceHandlers\fR. .SH "PLUGINS" .IX Header "PLUGINS" Plugins can be loaded using the \f(CW\*(C`\-P\f(CIplugin\f(CW\*(C'\fR syntax, eg: .PP .Vb 1 \& prove -PMyPlugin .Ve .PP This will search for a module named \f(CW\*(C`App::Prove::Plugin::MyPlugin\*(C'\fR, or failing that, \f(CW\*(C`MyPlugin\*(C'\fR. If the plugin can't be found, \f(CW\*(C`prove\*(C'\fR will complain & exit. .PP You can pass arguments to your plugin by appending \f(CW\*(C`=arg1,arg2,etc\*(C'\fR to the plugin name: .PP .Vb 1 \& prove -PMyPlugin=fou,du,fafa .Ve .PP Please check individual plugin documentation for more details. .Sh "Available Plugins" .IX Subsection "Available Plugins" For an up-to-date list of plugins available, please check \s-1CPAN:\s0 .PP .Sh "Writing Plugins" .IX Subsection "Writing Plugins" Please see \*(L"\s-1PLUGINS\s0\*(R" in App::Prove.