prove [options] [files or directories]
-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. -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. --trap Trap Ctrl-C and print summary on interrupt. --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 -V, --version Display the version -H, --man Longer manpage for prove --norc Don't process default .proverc
Options that take arguments:
-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.) --ext Set the extension for tests (default '.t') --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 --rules Rules for parallel vs sequential processing.
# .proverc --state=hot,fast,save -j9
Additional option files may be specified with the "--rc" option. Default option file processing is disabled by the "--norc" option.
Under Windows and VMS the option file is named _proverc rather than .proverc and is sought only in the current directory.
prove - < my_list_of_things_to_test.txt
See the "README" in the "examples" directory of this distribution.
Color support requires Term::ANSIColor on Unix-like platforms and Win32::Console on windows. If the necessary module is not installed colored output will not be available.
prove -v t/mytest.t :: --url http://example.com
would run t/mytest.t with the options '--url http://example.com'. When running multiple tests they will each receive the same arguments.
prove --exec '/usr/bin/ruby -w' t/ prove --exec '/usr/bin/perl -Tw -mstrict -Ilib' t/ prove --exec '/path/to/my/customer/exec'
This guarantees that STDOUT (where the test results appear) and STDERR (where the diagnostics appear) will stay in sync. The harness will display any diagnostics your tests emit on STDERR.
Caveat: this is a bit of a kludge. In particular note that if anything that appears on STDERR 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.
The "--state" switch requires an argument which must be a comma separated list of one or more of the following options.
# Run all tests in random order $ prove -b --state=save --shuffle # Run them again in the same order $ prove -b --state=last
# Run all tests $ prove -b --state=save # Run failures $ prove -b --state=failed
If you also specify the "save" option newly passing tests will be excluded from subsequent runs.
# Repeat until no more failures $ prove -b --state=failed,save
$ prove -b --state=failed,all,save
$ prove -b --state=hot,save
Tests that have never failed will not be selected. To run all tests with the most recently failed first use
$ prove -b --state=hot,all,save
This combination of options may also be specified thus
$ prove -b --state=adrian
$ prove -b --state=slow -j9
The "--state" switch may be used more than once.
$ prove -b --state=hot --state=all,save
The most practical use is likely to specify that some tests are not ``parallel-ready''. Since mentioning a file with --rules doesn't cause it to be selected to run as a test, you can ``set and forget'' some rules preferences in your .proverc file. Then you'll be able to take maximum advantage of the performance benefits of parallel testing, while some exceptions are still run in parallel.
--rules examples
# All tests are allowed to run in parallel, except those starting with "p" --rules='seq=t/p*.t' --rules='par=**' # All tests must run in sequence except those starting with "p", which should be run parallel --rules='par=t/p*.t'
--rules resolution
--rules Glob-style pattern matching
We implement our own glob-style pattern matching for --rules. Here are the supported patterns:
** is any number of characters, including /, within a pathname * is zero or more characters within a filename/directory name ? is exactly one character within a filename/directory name {foo,bar,baz} is any of foo, bar or baz. \ is an escape character
More advanced specifications for parallel vs sequence run rules
If you need more advanced management of what runs in parallel vs in sequence, see the associated 'rules' documentation in TAP::Harness and TAP::Parser::Scheduler. If what's possible directly through "prove" is not sufficient, you can write your own harness to access these features directly.
Because "PERL5LIB" is often used during testing to add build directories to @INC prove passes the names of any directories found in "PERL5LIB" as -I switches. The net effect of this is that "PERL5LIB" is honoured even when prove is run in taint mode.
prove --formatter MyFormatter
prove --source MyHandler --source YetAnother t
If you want to provide config to the source you can use:
prove --source MyCustom \ --source Perl --perl-option 'foo=bar baz' --perl-option avg=0.278 \ --source File --file-option extensions=.txt --file-option extensions=.tmp t --source pgTAP --pgtap-option pset=format=html --pgtap-option pset=border=2
Each "--$source-option" option must specify a key/value pair separated by an "=". If an option can take multiple values, just specify it multiple times, as with the "extensions=" examples above. If the option should be a hash reference, specify the value as a second pair separated by a "=", as in the "pset=" examples above (escape "=" with a backslash).
All "--sources" are combined into a hash, and passed to ``new'' in TAP::Harness's "sources" parameter.
See TAP::Parser::IteratorFactory for more details on how configuration is passed to SourceHandlers.
prove -PMyPlugin
This will search for a module named "App::Prove::Plugin::MyPlugin", or failing that, "MyPlugin". If the plugin can't be found, "prove" will complain & exit.
You can pass arguments to your plugin by appending "=arg1,arg2,etc" to the plugin name:
prove -PMyPlugin=fou,du,fafa
Please check individual plugin documentation for more details.
<http://search.cpan.org/search?query=App%3A%3AProve+Plugin>