Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 1 | lit - LLVM Integrated Tester |
| 2 | ============================ |
| 3 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 4 | SYNOPSIS |
| 5 | -------- |
| 6 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 7 | **lit** [*options*] [*tests*] |
| 8 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 9 | DESCRIPTION |
| 10 | ----------- |
| 11 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 12 | **lit** is a portable tool for executing LLVM and Clang style test suites, |
| 13 | summarizing their results, and providing indication of failures. **lit** is |
| 14 | designed to be a lightweight testing tool with as simple a user interface as |
| 15 | possible. |
| 16 | |
| 17 | **lit** should be run with one or more *tests* to run specified on the command |
| 18 | line. Tests can be either individual test files or directories to search for |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 19 | tests (see :ref:`test-discovery`). |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 20 | |
| 21 | Each specified test will be executed (potentially in parallel) and once all |
| 22 | tests have been run **lit** will print summary information on the number of tests |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 23 | which passed or failed (see :ref:`test-status-results`). The **lit** program will |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 24 | execute with a non-zero exit code if any tests fail. |
| 25 | |
| 26 | By default **lit** will use a succinct progress display and will only print |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 27 | summary information for test failures. See :ref:`output-options` for options |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 28 | controlling the **lit** progress display and output. |
| 29 | |
| 30 | **lit** also includes a number of options for controlling how tests are executed |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 31 | (specific features may depend on the particular test format). See |
| 32 | :ref:`execution-options` for more information. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 33 | |
| 34 | Finally, **lit** also supports additional options for only running a subset of |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 35 | the options specified on the command line, see :ref:`selection-options` for |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 36 | more information. |
| 37 | |
| 38 | Users interested in the **lit** architecture or designing a **lit** testing |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 39 | implementation should see :ref:`lit-infrastructure`. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 40 | |
| 41 | GENERAL OPTIONS |
| 42 | --------------- |
| 43 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 44 | **-h**, **--help** |
| 45 | |
| 46 | Show the **lit** help message. |
| 47 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 48 | **-j** *N*, **--threads**\ =\ *N* |
| 49 | |
| 50 | Run *N* tests in parallel. By default, this is automatically chosen to match |
| 51 | the number of detected available CPUs. |
| 52 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 53 | **--config-prefix**\ =\ *NAME* |
| 54 | |
| 55 | Search for *NAME.cfg* and *NAME.site.cfg* when searching for test suites, |
| 56 | instead of *lit.cfg* and *lit.site.cfg*. |
| 57 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 58 | **--param** *NAME*, **--param** *NAME*\ =\ *VALUE* |
| 59 | |
| 60 | Add a user defined parameter *NAME* with the given *VALUE* (or the empty |
| 61 | string if not given). The meaning and use of these parameters is test suite |
| 62 | dependent. |
| 63 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 64 | .. _output-options: |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 65 | |
| 66 | OUTPUT OPTIONS |
| 67 | -------------- |
| 68 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 69 | **-q**, **--quiet** |
| 70 | |
| 71 | Suppress any output except for test failures. |
| 72 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 73 | **-s**, **--succinct** |
| 74 | |
| 75 | Show less output, for example don't show information on tests that pass. |
| 76 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 77 | **-v**, **--verbose** |
| 78 | |
| 79 | Show more information on test failures, for example the entire test output |
| 80 | instead of just the test result. |
| 81 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 82 | **--no-progress-bar** |
| 83 | |
| 84 | Do not use curses based progress bar. |
| 85 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 86 | .. _execution-options: |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 87 | |
| 88 | EXECUTION OPTIONS |
| 89 | ----------------- |
| 90 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 91 | **--path**\ =\ *PATH* |
| 92 | |
| 93 | Specify an addition *PATH* to use when searching for executables in tests. |
| 94 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 95 | **--vg** |
| 96 | |
| 97 | Run individual tests under valgrind (using the memcheck tool). The |
| 98 | *--error-exitcode* argument for valgrind is used so that valgrind failures will |
| 99 | cause the program to exit with a non-zero status. |
| 100 | |
Daniel Dunbar | f854597 | 2012-10-19 20:12:00 +0000 | [diff] [blame] | 101 | When this option is enabled, **lit** will also automatically provide a |
| 102 | "valgrind" feature that can be used to conditionally disable (or expect failure |
| 103 | in) certain tests. |
| 104 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 105 | **--vg-arg**\ =\ *ARG* |
| 106 | |
| 107 | When *--vg* is used, specify an additional argument to pass to valgrind itself. |
| 108 | |
Daniel Dunbar | f854597 | 2012-10-19 20:12:00 +0000 | [diff] [blame] | 109 | **--vg-leak** |
| 110 | |
| 111 | When *--vg* is used, enable memory leak checks. When this option is enabled, |
Daniel Dunbar | 6b283ea | 2012-10-19 20:29:30 +0000 | [diff] [blame] | 112 | **lit** will also automatically provide a "vg_leak" feature that can be |
Daniel Dunbar | f854597 | 2012-10-19 20:12:00 +0000 | [diff] [blame] | 113 | used to conditionally disable (or expect failure in) certain tests. |
| 114 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 115 | **--time-tests** |
| 116 | |
| 117 | Track the wall time individual tests take to execute and includes the results in |
| 118 | the summary output. This is useful for determining which tests in a test suite |
| 119 | take the most time to execute. Note that this option is most useful with *-j |
| 120 | 1*. |
| 121 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 122 | .. _selection-options: |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 123 | |
| 124 | SELECTION OPTIONS |
| 125 | ----------------- |
| 126 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 127 | **--max-tests**\ =\ *N* |
| 128 | |
| 129 | Run at most *N* tests and then terminate. |
| 130 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 131 | **--max-time**\ =\ *N* |
| 132 | |
| 133 | Spend at most *N* seconds (approximately) running tests and then terminate. |
| 134 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 135 | **--shuffle** |
| 136 | |
| 137 | Run the tests in a random order. |
| 138 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 139 | ADDITIONAL OPTIONS |
| 140 | ------------------ |
| 141 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 142 | **--debug** |
| 143 | |
| 144 | Run **lit** in debug mode, for debugging configuration issues and **lit** itself. |
| 145 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 146 | **--show-suites** |
| 147 | |
| 148 | List the discovered test suites as part of the standard output. |
| 149 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 150 | **--no-tcl-as-sh** |
| 151 | |
| 152 | Run Tcl scripts internally (instead of converting to shell scripts). |
| 153 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 154 | **--repeat**\ =\ *N* |
| 155 | |
| 156 | Run each test *N* times. Currently this is primarily useful for timing tests, |
| 157 | other results are not collated in any reasonable fashion. |
| 158 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 159 | EXIT STATUS |
| 160 | ----------- |
| 161 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 162 | **lit** will exit with an exit code of 1 if there are any FAIL or XPASS |
| 163 | results. Otherwise, it will exit with the status 0. Other exit codes are used |
| 164 | for non-test related failures (for example a user error or an internal program |
| 165 | error). |
| 166 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 167 | .. _test-discovery: |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 168 | |
| 169 | TEST DISCOVERY |
| 170 | -------------- |
| 171 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 172 | The inputs passed to **lit** can be either individual tests, or entire |
| 173 | directories or hierarchies of tests to run. When **lit** starts up, the first |
| 174 | thing it does is convert the inputs into a complete list of tests to run as part |
| 175 | of *test discovery*. |
| 176 | |
| 177 | In the **lit** model, every test must exist inside some *test suite*. **lit** |
| 178 | resolves the inputs specified on the command line to test suites by searching |
| 179 | upwards from the input path until it finds a *lit.cfg* or *lit.site.cfg* |
| 180 | file. These files serve as both a marker of test suites and as configuration |
| 181 | files which **lit** loads in order to understand how to find and run the tests |
| 182 | inside the test suite. |
| 183 | |
| 184 | Once **lit** has mapped the inputs into test suites it traverses the list of |
| 185 | inputs adding tests for individual files and recursively searching for tests in |
| 186 | directories. |
| 187 | |
| 188 | This behavior makes it easy to specify a subset of tests to run, while still |
| 189 | allowing the test suite configuration to control exactly how tests are |
| 190 | interpreted. In addition, **lit** always identifies tests by the test suite they |
| 191 | are in, and their relative path inside the test suite. For appropriately |
| 192 | configured projects, this allows **lit** to provide convenient and flexible |
| 193 | support for out-of-tree builds. |
| 194 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 195 | .. _test-status-results: |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 196 | |
| 197 | TEST STATUS RESULTS |
| 198 | ------------------- |
| 199 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 200 | Each test ultimately produces one of the following six results: |
| 201 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 202 | **PASS** |
| 203 | |
| 204 | The test succeeded. |
| 205 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 206 | **XFAIL** |
| 207 | |
| 208 | The test failed, but that is expected. This is used for test formats which allow |
| 209 | specifying that a test does not currently work, but wish to leave it in the test |
| 210 | suite. |
| 211 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 212 | **XPASS** |
| 213 | |
| 214 | The test succeeded, but it was expected to fail. This is used for tests which |
| 215 | were specified as expected to fail, but are now succeeding (generally because |
| 216 | the feature they test was broken and has been fixed). |
| 217 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 218 | **FAIL** |
| 219 | |
| 220 | The test failed. |
| 221 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 222 | **UNRESOLVED** |
| 223 | |
| 224 | The test result could not be determined. For example, this occurs when the test |
| 225 | could not be run, the test itself is invalid, or the test was interrupted. |
| 226 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 227 | **UNSUPPORTED** |
| 228 | |
| 229 | The test is not supported in this environment. This is used by test formats |
| 230 | which can report unsupported tests. |
| 231 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 232 | Depending on the test format tests may produce additional information about |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 233 | their status (generally only for failures). See the :ref:`output-options` |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 234 | section for more information. |
| 235 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 236 | .. _lit-infrastructure: |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 237 | |
| 238 | LIT INFRASTRUCTURE |
| 239 | ------------------ |
| 240 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 241 | This section describes the **lit** testing architecture for users interested in |
| 242 | creating a new **lit** testing implementation, or extending an existing one. |
| 243 | |
| 244 | **lit** proper is primarily an infrastructure for discovering and running |
| 245 | arbitrary tests, and to expose a single convenient interface to these |
| 246 | tests. **lit** itself doesn't know how to run tests, rather this logic is |
| 247 | defined by *test suites*. |
| 248 | |
| 249 | TEST SUITES |
| 250 | ~~~~~~~~~~~ |
| 251 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 252 | As described in :ref:`test-discovery`, tests are always located inside a *test |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 253 | suite*. Test suites serve to define the format of the tests they contain, the |
| 254 | logic for finding those tests, and any additional information to run the tests. |
| 255 | |
| 256 | **lit** identifies test suites as directories containing *lit.cfg* or |
| 257 | *lit.site.cfg* files (see also **--config-prefix**). Test suites are initially |
| 258 | discovered by recursively searching up the directory hierarchy for all the input |
| 259 | files passed on the command line. You can use **--show-suites** to display the |
| 260 | discovered test suites at startup. |
| 261 | |
| 262 | Once a test suite is discovered, its config file is loaded. Config files |
| 263 | themselves are Python modules which will be executed. When the config file is |
| 264 | executed, two important global variables are predefined: |
| 265 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 266 | **lit** |
| 267 | |
| 268 | The global **lit** configuration object (a *LitConfig* instance), which defines |
| 269 | the builtin test formats, global configuration parameters, and other helper |
| 270 | routines for implementing test configurations. |
| 271 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 272 | **config** |
| 273 | |
| 274 | This is the config object (a *TestingConfig* instance) for the test suite, |
| 275 | which the config file is expected to populate. The following variables are also |
| 276 | available on the *config* object, some of which must be set by the config and |
| 277 | others are optional or predefined: |
| 278 | |
| 279 | **name** *[required]* The name of the test suite, for use in reports and |
| 280 | diagnostics. |
| 281 | |
| 282 | **test_format** *[required]* The test format object which will be used to |
| 283 | discover and run tests in the test suite. Generally this will be a builtin test |
| 284 | format available from the *lit.formats* module. |
| 285 | |
| 286 | **test_src_root** The filesystem path to the test suite root. For out-of-dir |
| 287 | builds this is the directory that will be scanned for tests. |
| 288 | |
| 289 | **test_exec_root** For out-of-dir builds, the path to the test suite root inside |
| 290 | the object directory. This is where tests will be run and temporary output files |
| 291 | placed. |
| 292 | |
| 293 | **environment** A dictionary representing the environment to use when executing |
| 294 | tests in the suite. |
| 295 | |
| 296 | **suffixes** For **lit** test formats which scan directories for tests, this |
| 297 | variable is a list of suffixes to identify test files. Used by: *ShTest*, |
| 298 | *TclTest*. |
| 299 | |
| 300 | **substitutions** For **lit** test formats which substitute variables into a test |
| 301 | script, the list of substitutions to perform. Used by: *ShTest*, *TclTest*. |
| 302 | |
| 303 | **unsupported** Mark an unsupported directory, all tests within it will be |
| 304 | reported as unsupported. Used by: *ShTest*, *TclTest*. |
| 305 | |
| 306 | **parent** The parent configuration, this is the config object for the directory |
| 307 | containing the test suite, or None. |
| 308 | |
| 309 | **root** The root configuration. This is the top-most **lit** configuration in |
| 310 | the project. |
| 311 | |
| 312 | **on_clone** The config is actually cloned for every subdirectory inside a test |
| 313 | suite, to allow local configuration on a per-directory basis. The *on_clone* |
| 314 | variable can be set to a Python function which will be called whenever a |
| 315 | configuration is cloned (for a subdirectory). The function should takes three |
| 316 | arguments: (1) the parent configuration, (2) the new configuration (which the |
| 317 | *on_clone* function will generally modify), and (3) the test path to the new |
| 318 | directory being scanned. |
| 319 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 320 | TEST DISCOVERY |
| 321 | ~~~~~~~~~~~~~~ |
| 322 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 323 | Once test suites are located, **lit** recursively traverses the source directory |
| 324 | (following *test_src_root*) looking for tests. When **lit** enters a |
| 325 | sub-directory, it first checks to see if a nested test suite is defined in that |
| 326 | directory. If so, it loads that test suite recursively, otherwise it |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 327 | instantiates a local test config for the directory (see |
| 328 | :ref:`local-configuration-files`). |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 329 | |
| 330 | Tests are identified by the test suite they are contained within, and the |
| 331 | relative path inside that suite. Note that the relative path may not refer to an |
| 332 | actual file on disk; some test formats (such as *GoogleTest*) define "virtual |
| 333 | tests" which have a path that contains both the path to the actual test file and |
| 334 | a subpath to identify the virtual test. |
| 335 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 336 | .. _local-configuration-files: |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 337 | |
| 338 | LOCAL CONFIGURATION FILES |
| 339 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 340 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 341 | When **lit** loads a subdirectory in a test suite, it instantiates a local test |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 342 | configuration by cloning the configuration for the parent direction --- the root |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 343 | of this configuration chain will always be a test suite. Once the test |
| 344 | configuration is cloned **lit** checks for a *lit.local.cfg* file in the |
| 345 | subdirectory. If present, this file will be loaded and can be used to specialize |
| 346 | the configuration for each individual directory. This facility can be used to |
| 347 | define subdirectories of optional tests, or to change other configuration |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 348 | parameters --- for example, to change the test format, or the suffixes which |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 349 | identify test files. |
| 350 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 351 | TEST RUN OUTPUT FORMAT |
| 352 | ~~~~~~~~~~~~~~~~~~~~~~ |
| 353 | |
Eli Bendersky | 1f9f73a | 2012-11-20 00:26:08 +0000 | [diff] [blame] | 354 | The **lit** output for a test run conforms to the following schema, in both |
| 355 | short and verbose modes (although in short mode no PASS lines will be shown). |
| 356 | This schema has been chosen to be relatively easy to reliably parse by a machine |
| 357 | (for example in buildbot log scraping), and for other tools to generate. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 358 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 359 | Each test result is expected to appear on a line that matches: |
| 360 | |
| 361 | .. code-block:: none |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 362 | |
Eli Bendersky | 1f9f73a | 2012-11-20 00:26:08 +0000 | [diff] [blame] | 363 | <result code>: <test name> (<progress info>) |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 364 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 365 | where ``<result-code>`` is a standard test result such as PASS, FAIL, XFAIL, |
| 366 | XPASS, UNRESOLVED, or UNSUPPORTED. The performance result codes of IMPROVED and |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 367 | REGRESSED are also allowed. |
| 368 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 369 | The ``<test name>`` field can consist of an arbitrary string containing no |
| 370 | newline. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 371 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 372 | The ``<progress info>`` field can be used to report progress information such |
| 373 | as (1/300) or can be empty, but even when empty the parentheses are required. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 374 | |
| 375 | Each test result may include additional (multiline) log information in the |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 376 | following format: |
| 377 | |
| 378 | .. code-block:: none |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 379 | |
Eli Bendersky | 1f9f73a | 2012-11-20 00:26:08 +0000 | [diff] [blame] | 380 | <log delineator> TEST '(<test name>)' <trailing delineator> |
| 381 | ... log message ... |
| 382 | <log delineator> |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 383 | |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 384 | where ``<test name>`` should be the name of a preceding reported test, ``<log |
| 385 | delineator>`` is a string of "*" characters *at least* four characters long |
| 386 | (the recommended length is 20), and ``<trailing delineator>`` is an arbitrary |
| 387 | (unparsed) string. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 388 | |
| 389 | The following is an example of a test run output which consists of four tests A, |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 390 | B, C, and D, and a log message for the failing test C: |
| 391 | |
| 392 | .. code-block:: none |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 393 | |
| 394 | PASS: A (1 of 4) |
| 395 | PASS: B (2 of 4) |
| 396 | FAIL: C (3 of 4) |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 397 | ******************** TEST 'C' FAILED ******************** |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 398 | Test 'C' failed as a result of exit code 1. |
Dmitri Gribenko | e26b62c | 2012-11-29 17:05:34 +0000 | [diff] [blame] | 399 | ******************** |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 400 | PASS: D (4 of 4) |
| 401 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 402 | LIT EXAMPLE TESTS |
| 403 | ~~~~~~~~~~~~~~~~~ |
| 404 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 405 | The **lit** distribution contains several example implementations of test suites |
| 406 | in the *ExampleTests* directory. |
| 407 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 408 | SEE ALSO |
| 409 | -------- |
| 410 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 411 | valgrind(1) |