blob: a818302c242aabf2162f351da086831c2191b7f1 [file] [log] [blame]
Daniel Dunbarbe7ada72009-09-08 05:31:18 +00001=pod
2
3=head1 NAME
4
5lit - LLVM Integrated Tester
6
7=head1 SYNOPSIS
8
9B<lit> [I<options>] [I<tests>]
10
11=head1 DESCRIPTION
12
13B<lit> is a portable tool for executing LLVM and Clang style test suites,
14summarizing their results, and providing indication of failures. B<lit> is
15designed to be a lightweight testing tool with as simple a user interface as
16possible.
17
18B<lit> should be run with one or more I<tests> to run specified on the command
19line. Tests can be either individual test files or directories to search for
20tests (see L<"TEST DISCOVERY">).
21
22Each specified test will be executed (potentially in parallel) and once all
23tests have been run B<lit> will print summary information on the number of tests
24which passed or failed (see L<"TEST STATUS RESULTS">). The B<lit> program will
25execute with a non-zero exit code if any tests fail.
26
27By default B<lit> will use a succinct progress display and will only print
28summary information for test failures. See L<"OUTPUT OPTIONS"> for options
29controlling the B<lit> progress display and output.
30
31B<lit> also includes a number of options for controlling how tests are exected
32(specific features may depend on the particular test format). See L<"EXECUTION
33OPTIONS"> for more information.
34
35Finally, B<lit> also supports additional options for only running a subset of
36the options specified on the command line, see L<"SELECTION OPTIONS"> for
37more information.
38
39=head1 GENERAL OPTIONS
40
41=over
42
43=item B<-h>, B<--help>
44
45Show the B<lit> help message.
46
47=item B<-j> I<N>, B<--threads>=I<N>
48
49Run I<N> tests in parallel. By default, this is automatically chose to match the
50number of detected available CPUs.
51
52=back
53
54=head1 OUTPUT OPTIONS
55
56=over
57
58=item B<-q>, B<--quiet>
59
60Suppress any output except for test failures.
61
62=item B<-s>, B<--succinct>
63
64Show less output, for example don't show information on tests that pass.
65
66=item B<-v>, B<--verbose>
67
68Show more information on test failures, for example the entire test output
69instead of just the test result.
70
71=item B<--no-progress-bar>
72
73Do not use curses based progress bar.
74
75=back
76
77=head1 EXECUTION OPTIONS
78
79=over
80
81=item B<--path>=I<PATH>
82
83Specify an addition I<PATH> to use when searching for executables in tests.
84
85=item B<--vg>
86
87Run individual tests under valgrind (using the memcheck tool). The
88I<--error-exitcode> argument for valgrind is used so that valgrind failures will
89cause the program to exit with a non-zero status.
90
91=item B<--vg-arg>=I<ARG>
92
93When I<--vg> is used, specify an additional argument to pass to valgrind itself.
94
95=item B<--time-tests>
96
97Track the wall time individual tests take to execute and includes the results in
98the summary output. This is useful for determining which tests in a test suite
99take the most time to execute. Note that this option is most useful with I<-j
1001>.
101
102=back
103
104=head1 SELECTION OPTIONS
105
106=over
107
108=item B<--max-tests>=I<N>
109
110Run at most I<N> tests and then terminate.
111
112=item B<--max-time>=I<N>
113
114Spend at most I<N> seconds (approximately) running tests and then terminate.
115
116=item B<--shuffle>
117
118Run the tests in a random order.
119
120=back
121
122=head1 ADDITIONAL OPTIONS
123
124=over
125
126=item B<--debug>
127
128Run B<lit> in debug mode, for debugging configuration issues and B<lit> itself.
129
130=item B<--show-suites>
131
132List the discovered test suites as part of the standard output.
133
134=item B<--no-tcl-as-sh>
135
136Run Tcl scripts internally (instead of converting to shell scripts).
137
138=back
139
140=head1 EXIT STATUS
141
142B<lit> will exit with an exit code of 1 if there are any FAIL or XPASS
143results. Otherwise, it will exit with the status 0. Other exit codes used for
144non-test related failures (for example a user error or an internal program
145error).
146
147=head1 TEST DISCOVERY
148
149The inputs passed to B<lit> can be either individual tests, or entire
150directories or hierarchies of tests to run. When B<lit> starts up, the first
151thing it does is convert the inputs into a complete list of tests to run as part
152of I<test discovery>.
153
154In the B<lit> model, every test must exist inside some I<test suite>. B<lit>
155resolves the inputs specified on the command line to test suites by searching
156upwards from the input path until it finds a I<lit.cfg> or I<lit.site.cfg>
157file. These files serve as both a marker of test suites and as configuration
158files which B<lit> loads in order to understand how to find and run the tests
159inside the test suite.
160
161Once B<lit> has mapped the inputs into test suites it traverses the list of
162inputs adding tests for individual files and recursively searching for tests in
163directories.
164
165This behavior makes it easy to specify a subset of tests to run, while still
166allowing the test suite configuration to control exactly how tests are
167interpreted. In addition, B<lit> always identifies tests by the test suite they
168are in, and their relative path inside the test suite. For appropriately
169configured projects, this allows B<lit> to provide convenient and flexible
170support for out-of-tree builds.
171
172=head1 TEST STATUS RESULTS
173
174Each test ultimately produces one of the following six results:
175
176=over
177
178=item B<PASS>
179
180The test succeeded.
181
182=item B<XFAIL>
183
184The test failed, but that is expected. This is used for test formats which allow
185specifying that a test does not currently work, but wish to leave it in the test
186suite.
187
188=item B<XPASS>
189
190The test succeeded, but it was expected to fail. This is used for tests which
191were specified as expected to fail, but are now succeeding (generally because
192the feautre they test was broken and has been fixed).
193
194=item B<FAIL>
195
196The test failed.
197
198=item B<UNRESOLVED>
199
200The test result could not be determined. For example, this occurs when the test
201could not be run, the test itself is invalid, or the test was interrupted.
202
203=item B<UNSUPPORTED>
204
205The test is not supported in this environment. This is used by test formats
206which can report unsupported tests.
207
208=back
209
210Depending on the test format tests may produce additional information about
211their status (generally only for failures). See the L<Output|"LIT OUTPUT">
212section for more information.
213
214=head1 SEE ALSO
215
216L<valgrind(1)>
217
218=head1 AUTHOR
219
220Written by Daniel Dunbar and maintained by the LLVM Team (L<http://llvm.org>).
221
222=cut