really add the new files
[gitmo/moose-presentations.git] / moose-class / exercises / bin / prove
CommitLineData
4920168e 1#!/usr/bin/perl -w
2
3eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
4 if 0; # not running under some shell
5
6use strict;
7use lib 't/lib';
8use App::Prove;
9
10my $app = App::Prove->new;
11$app->process_args(@ARGV);
12$app->run;
13
14__END__
15
16=head1 NAME
17
18prove - Run tests through a TAP harness.
19
20=head1 USAGE
21
22 prove [options] [files or directories]
23
24=head1 OPTIONS
25
26Boolean options:
27
28 -v, --verbose Print all test lines.
29 -l, --lib Add 'lib' to the path for your tests (-Ilib).
30 -b, --blib Add 'blib/lib' to the path for your tests (-Iblib/lib).
31 -s, --shuffle Run the tests in random order.
32 -c, --color Colored test output (default).
33 --nocolor Do not color test output.
34 -f, --failures Only show failed tests.
35 --fork Fork to run harness in multiple processes
36 -m, --merge Merge test scripts' STDERR with their STDOUT.
37 -r, --recurse Recursively descend into directories.
38 --reverse Run the tests in reverse order.
39 -q, --quiet Suppress some test output while running tests.
40 -Q, --QUIET Only print summary results.
41 -p, --parse Show full list of TAP parse errors, if any.
42 --directives Only show results with TODO or SKIP directives.
43 --timer Print elapsed time after each test.
44 -T Enable tainting checks.
45 -t Enable tainting warnings.
46 -W Enable fatal warnings.
47 -w Enable warnings.
48 -h, --help Display this help
49 -?, Display this help
50 -H, --man Longer manpage for prove
51
52Options that take arguments:
53
54 -I Library paths to include.
55 -P Load plugin (searches App::Prove::Plugin::*.)
56 -M Load a module.
57 -e, --exec Interpreter to run the tests ('' for compiled tests.)
58 --harness Define test harness to use. See TAP::Harness.
59 --formatter Result formatter to use. See TAP::Harness.
60 -a, --archive Store the resulting TAP in an archive file.
61 -j, --jobs N Run N test jobs in parallel (try 9.)
62
63=head2 Reading from C<STDIN>
64
65If you have a list of tests (or URLs, or anything else you want to test) in a
66file, you can add them to your tests by using a '-':
67
68 prove - < my_list_of_things_to_test.txt
69
70See the C<README> in the C<examples> directory of this distribution.
71
72=head1 NOTES
73
74=head2 Default Test Directory
75
76If no files or directories are supplied, C<prove> looks for all files
77matching the pattern C<t/*.t>.
78
79=head2 Colored Test Output
80
81Colored test output is the default, but if output is not to a
82terminal, color is disabled. You can override this by adding the
83C<--color> switch.
84
85Color support requires L<Term::ANSIColor> on Unix-like platforms and
86L<Win32::Console> windows. If the necessary module is not installed
87colored output will not be available.
88
89=head2 C<--exec>
90
91Normally you can just pass a list of Perl tests and the harness will know how
92to execute them. However, if your tests are not written in Perl or if you
93want all tests invoked exactly the same way, use the C<-e>, or C<--exec>
94switch:
95
96 prove --exec '/usr/bin/ruby -w' t/
97 prove --exec '/usr/bin/perl -Tw -mstrict -Ilib' t/
98 prove --exec '/path/to/my/customer/exec'
99
100=head2 C<--merge>
101
102If you need to make sure your diagnostics are displayed in the correct
103order relative to test results you can use the C<--merge> option to
104merge the test scripts' STDERR into their STDOUT.
105
106This guarantees that STDOUT (where the test results appear) and STDOUT
107(where the diagnostics appear) will stay in sync. The harness will
108display any diagnostics your tests emit on STDERR.
109
110Caveat: this is a bit of a kludge. In particular note that if anything
111that appears on STDERR looks like a test result the test harness will
112get confused. Use this option only if you understand the consequences
113and can live with the risk.
114
115=head1 PERFORMANCE
116
117Because of its design, C<TAP::Parser> collects more information than
118C<Test::Harness>. However, the trade-off is sometimes slightly slower
119performance than when using the C<prove> utility which is bundled with
120L<Test::Harness>. For small tests suites, this is usually not a problem.
121However, enabling the C<--quiet> or C<--QUIET> options can sometimes speed up
122the test suite, sometimes running faster than C<prove>.
123
124=head1 SEE ALSO
125
126C<prove>, which comes with L<Test::Harness> and whose code I've nicked in a
127few places (thanks Andy!).
128
129=head1 CAVEATS
130
131This is alpha code. You've been warned.
132
133=cut
134
135# vim:ts=4:sw=4:et:sta