6 my $app = App::Prove->new;
7 $app->process_args(@ARGV);
8 exit( $app->run ? 0 : 1 );
14 prove - Run tests through a TAP harness.
18 prove [options] [files or directories]
24 -v, --verbose Print all test lines.
25 -l, --lib Add 'lib' to the path for your tests (-Ilib).
26 -b, --blib Add 'blib/lib' and 'blib/arch' to the path for your tests
27 -s, --shuffle Run the tests in random order.
28 -c, --color Colored test output (default).
29 --nocolor Do not color test output.
30 --count Show the X/Y test count when not verbose (default)
31 --nocount Disable the X/Y test count.
32 -D --dry Dry run. Show test that would have run.
33 --ext Set the extension for tests (default '.t')
34 -f, --failures Only show failed tests.
35 --fork Fork to run harness in multiple processes.
36 --ignore-exit Ignore exit status from test scripts.
37 -m, --merge Merge test scripts' STDERR with their STDOUT.
38 -r, --recurse Recursively descend into directories.
39 --reverse Run the tests in reverse order.
40 -q, --quiet Suppress some test output while running tests.
41 -Q, --QUIET Only print summary results.
42 -p, --parse Show full list of TAP parse errors, if any.
43 --directives Only show results with TODO or SKIP directives.
44 --timer Print elapsed time after each test.
45 -T Enable tainting checks.
46 -t Enable tainting warnings.
47 -W Enable fatal warnings.
49 -h, --help Display this help
51 -H, --man Longer manpage for prove
52 --norc Don't process default .proverc
54 Options that take arguments:
56 -I Library paths to include.
57 -P Load plugin (searches App::Prove::Plugin::*.)
59 -e, --exec Interpreter to run the tests ('' for compiled tests.)
60 --harness Define test harness to use. See TAP::Harness.
61 --formatter Result formatter to use. See TAP::Harness.
62 -a, --archive Store the resulting TAP in an archive file.
63 -j, --jobs N Run N test jobs in parallel (try 9.)
64 --state=opts Control prove's persistent state.
65 --rc=rcfile Process options from rcfile
71 If F<~/.proverc> or F<./.proverc> exist they will be read and any
72 options they contain processed before the command line options. Options
73 in F<.proverc> are specified in the same way as command line options:
79 Additional option files may be specified with the C<--rc> option.
80 Default option file processing is disabled by the C<--norc> option.
82 Under Windows and VMS the option file is named F<_proverc> rather than
83 F<.proverc> and is sought only in the current directory.
85 =head2 Reading from C<STDIN>
87 If you have a list of tests (or URLs, or anything else you want to test) in a
88 file, you can add them to your tests by using a '-':
90 prove - < my_list_of_things_to_test.txt
92 See the C<README> in the C<examples> directory of this distribution.
94 =head2 Default Test Directory
96 If no files or directories are supplied, C<prove> looks for all files
97 matching the pattern C<t/*.t>.
99 =head2 Colored Test Output
101 Colored test output is the default, but if output is not to a
102 terminal, color is disabled. You can override this by adding the
105 Color support requires L<Term::ANSIColor> on Unix-like platforms and
106 L<Win32::Console> windows. If the necessary module is not installed
107 colored output will not be available.
109 =head2 Arguments to Tests
111 It is possible to supply arguments to tests. To do so separate them from
112 prove's own arguments with the arisdottle, '::'. For example
114 prove -v t/mytest.t :: --url http://example.com
116 would run F<t/mytest.t> with the options '--url http://example.com'.
117 When running multiple tests they will each receive the same arguments.
121 Normally you can just pass a list of Perl tests and the harness will know how
122 to execute them. However, if your tests are not written in Perl or if you
123 want all tests invoked exactly the same way, use the C<-e>, or C<--exec>
126 prove --exec '/usr/bin/ruby -w' t/
127 prove --exec '/usr/bin/perl -Tw -mstrict -Ilib' t/
128 prove --exec '/path/to/my/customer/exec'
132 If you need to make sure your diagnostics are displayed in the correct
133 order relative to test results you can use the C<--merge> option to
134 merge the test scripts' STDERR into their STDOUT.
136 This guarantees that STDOUT (where the test results appear) and STDOUT
137 (where the diagnostics appear) will stay in sync. The harness will
138 display any diagnostics your tests emit on STDERR.
140 Caveat: this is a bit of a kludge. In particular note that if anything
141 that appears on STDERR looks like a test result the test harness will
142 get confused. Use this option only if you understand the consequences
143 and can live with the risk.
147 You can ask C<prove> to remember the state of previous test runs and
148 select and/or order the tests to be run based on that saved state.
150 The C<--state> switch requires an argument which must be a comma
151 separated list of one or more of the following options.
157 Run the same tests as the last time the state was saved. This makes it
158 possible, for example, to recreate the ordering of a shuffled test.
160 # Run all tests in random order
161 $ prove -b --state=save --shuffle
163 # Run them again in the same order
164 $ prove -b --state=last
168 Run only the tests that failed on the last run.
171 $ prove -b --state=save
174 $ prove -b --state=failed
176 If you also specify the C<save> option newly passing tests will be
177 excluded from subsequent runs.
179 # Repeat until no more failures
180 $ prove -b --state=failed,save
184 Run only the passed tests from last time. Useful to make sure that no
185 new problems have been introduced.
189 Run all tests in normal order. Multple options may be specified, so to
190 run all tests with the failures from last time first:
192 $ prove -b --state=failed,all,save
196 Run the tests that most recently failed first. The last failure time of
197 each test is stored. The C<hot> option causes tests to be run in most-recent-
200 $ prove -b --state=hot,save
202 Tests that have never failed will not be selected. To run all tests with
203 the most recently failed first use
205 $ prove -b --state=hot,all,save
207 This combination of options may also be specified thus
209 $ prove -b --state=adrian
213 Run any tests with todos.
217 Run the tests in slowest to fastest order. This is useful in conjunction
218 with the C<-j> parallel testing switch to ensure that your slowest tests
221 $ prove -b --state=slow -j9
225 Run test tests in fastest to slowest order.
229 Run the tests in newest to oldest order based on the modification times
234 Run the tests in oldest to newest order.
238 Run those test scripts that have been modified since the last test run.
242 Save the state on exit. The state is stored in a file called F<.prove>
243 (F<_prove> on Windows and VMS) in the current directory.
247 The C<--state> switch may be used more than once.
249 $ prove -b --state=hot --state=all,save
253 Normally when a Perl program is run in taint mode the contents of the
254 C<PERL5LIB> environment variable do not appear in C<@INC>.
256 Because C<PERL5LIB> is often used during testing to add build directories
257 to C<@INC> prove (actually L<TAP::Parser::Source::Perl>) passes the
258 names of any directories found in C<PERL5LIB> as -I switches. The net
259 effect of this is that C<PERL5LIB> is honoured even when prove is run in
264 # vim:ts=4:sw=4:et:sta