really add the new files
[gitmo/moose-presentations.git] / moose-class / exercises / bin / prove
1 #!/usr/bin/perl -w
2
3 eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
4     if 0; # not running under some shell
5
6 use strict;
7 use lib 't/lib';
8 use App::Prove;
9
10 my $app = App::Prove->new;
11 $app->process_args(@ARGV);
12 $app->run;
13
14 __END__
15
16 =head1 NAME
17
18 prove - Run tests through a TAP harness.
19
20 =head1 USAGE
21
22  prove [options] [files or directories]
23
24 =head1 OPTIONS
25
26 Boolean 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
52 Options 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
65 If you have a list of tests (or URLs, or anything else you want to test) in a
66 file, you can add them to your tests by using a '-':
67
68  prove - < my_list_of_things_to_test.txt
69
70 See the C<README> in the C<examples> directory of this distribution.
71
72 =head1 NOTES
73
74 =head2 Default Test Directory
75
76 If no files or directories are supplied, C<prove> looks for all files
77 matching the pattern C<t/*.t>.
78
79 =head2 Colored Test Output
80
81 Colored test output is the default, but if output is not to a
82 terminal, color is disabled. You can override this by adding the 
83 C<--color> switch.
84
85 Color support requires L<Term::ANSIColor> on Unix-like platforms and
86 L<Win32::Console> windows. If the necessary module is not installed
87 colored output will not be available.
88
89 =head2 C<--exec>
90
91 Normally you can just pass a list of Perl tests and the harness will know how
92 to execute them.  However, if your tests are not written in Perl or if you
93 want all tests invoked exactly the same way, use the C<-e>, or C<--exec>
94 switch:
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
102 If you need to make sure your diagnostics are displayed in the correct
103 order relative to test results you can use the C<--merge> option to
104 merge the test scripts' STDERR into their STDOUT. 
105
106 This guarantees that STDOUT (where the test results appear) and STDOUT
107 (where the diagnostics appear) will stay in sync. The harness will
108 display any diagnostics your tests emit on STDERR.
109
110 Caveat: this is a bit of a kludge. In particular note that if anything
111 that appears on STDERR looks like a test result the test harness will
112 get confused. Use this option only if you understand the consequences
113 and can live with the risk.
114
115 =head1 PERFORMANCE
116
117 Because of its design, C<TAP::Parser> collects more information than
118 C<Test::Harness>.  However, the trade-off is sometimes slightly slower
119 performance than when using the C<prove> utility which is bundled with
120 L<Test::Harness>.  For small tests suites, this is usually not a problem.
121 However, enabling the C<--quiet> or C<--QUIET> options can sometimes speed up
122 the test suite, sometimes running faster than C<prove>.
123
124 =head1 SEE ALSO
125
126 C<prove>, which comes with L<Test::Harness> and whose code I've nicked in a
127 few places (thanks Andy!).
128
129 =head1 CAVEATS
130
131 This is alpha code.  You've been warned.
132
133 =cut
134
135 # vim:ts=4:sw=4:et:sta