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