• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:suite

1 lit - LLVM Integrated Tester
5 --------
10 -----------
12 :program:`lit` is a portable tool for executing LLVM and Clang style test
18 command line. Tests can be either individual test files or directories to
19 search for tests (see :ref:`test-discovery`).
21 Each specified test will be executed (potentially in parallel) and once all
23 of tests which passed or failed (see :ref:`test-status-results`). The
24 :program:`lit` program will execute with a non-zero exit code if any tests
28 print summary information for test failures. See :ref:`output-options` for
32 executed (specific features may depend on the particular test format). See
33 :ref:`execution-options` for more information.
37 :ref:`selection-options` for more information.
40 :program:`lit` testing implementation should see :ref:`lit-infrastructure`.
43 ---------------
45 .. option:: -h, --help
49 .. option:: -j N, --threads=N
54 .. option:: --config-prefix=NAME
57 test suites, instead of :file:`lit.cfg` and :file:`lit.site.cfg`.
59 .. option:: -D NAME, -D NAME=VALUE, --param NAME, --param NAME=VALUE
62 string if not given). The meaning and use of these parameters is test suite
65 .. _output-options:
68 --------------
70 .. option:: -q, --quiet
72 Suppress any output except for test failures.
74 .. option:: -s, --succinct
78 .. option:: -v, --verbose
80 Show more information on test failures, for example the entire test output
81 instead of just the test result.
83 .. option:: -a, --show-all
85 Show more information about all tests, for example the entire test
88 .. option:: --no-progress-bar
92 .. option:: --show-unsupported
96 .. option:: --show-xfail
100 .. _execution-options:
103 -----------------
105 .. option:: --path=PATH
109 .. option:: --vg
112 ``--error-exitcode`` argument for valgrind is used so that valgrind failures
113 will cause the program to exit with a non-zero status.
119 .. option:: --vg-arg=ARG
121 When :option:`--vg` is used, specify an additional argument to pass to
124 .. option:: --vg-leak
126 When :option:`--vg` is used, enable memory leak checks. When this option is
131 .. option:: --time-tests
134 in the summary output. This is useful for determining which tests in a test
135 suite take the most time to execute. Note that this option is most useful
136 with ``-j 1``.
138 .. _selection-options:
141 -----------------
143 .. option:: --max-tests=N
147 .. option:: --max-time=N
151 .. option:: --shuffle
156 ------------------
158 .. option:: --debug
163 .. option:: --show-suites
165 List the discovered test suites and exit.
167 .. option:: --show-tests
172 -----------
176 for non-test related failures (for example a user error or an internal program
179 .. _test-discovery:
181 TEST DISCOVERY
182 --------------
187 as part of *test discovery*.
189 In the :program:`lit` model, every test must exist inside some *test suite*.
190 :program:`lit` resolves the inputs specified on the command line to test suites
192 :file:`lit.site.cfg` file. These files serve as both a marker of test suites
194 how to find and run the tests inside the test suite.
196 Once :program:`lit` has mapped the inputs into test suites it traverses the
201 allowing the test suite configuration to control exactly how tests are
202 interpreted. In addition, :program:`lit` always identifies tests by the test
203 suite they are in, and their relative path inside the test suite. For
205 convenient and flexible support for out-of-tree builds.
207 .. _test-status-results:
209 TEST STATUS RESULTS
210 -------------------
212 Each test ultimately produces one of the following six results:
216 The test succeeded.
220 The test failed, but that is expected. This is used for test formats which allow
221 specifying that a test does not currently work, but wish to leave it in the test
222 suite.
226 The test succeeded, but it was expected to fail. This is used for tests which
228 the feature they test was broken and has been fixed).
232 The test failed.
236 The test result could not be determined. For example, this occurs when the test
237 could not be run, the test itself is invalid, or the test was interrupted.
241 The test is not supported in this environment. This is used by test formats
244 Depending on the test format tests may produce additional information about
245 their status (generally only for failures). See the :ref:`output-options`
248 .. _lit-infrastructure:
251 ------------------
259 defined by *test suites*.
261 TEST SUITES
264 As described in :ref:`test-discovery`, tests are always located inside a *test
265 suite*. Test suites serve to define the format of the tests they contain, the
268 :program:`lit` identifies test suites as directories containing ``lit.cfg`` or
269 ``lit.site.cfg`` files (see also :option:`--config-prefix`). Test suites are
272 :option:`--show-suites` to display the discovered test suites at startup.
274 Once a test suite is discovered, its config file is loaded. Config files
281 the builtin test formats, global configuration parameters, and other helper
282 routines for implementing test configurations.
286 This is the config object (a *TestingConfig* instance) for the test suite,
291 **name** *[required]* The name of the test suite, for use in reports and
294 **test_format** *[required]* The test format object which will be used to
295 discover and run tests in the test suite. Generally this will be a builtin test
298 **test_source_root** The filesystem path to the test suite root. For out-of-dir
301 **test_exec_root** For out-of-dir builds, the path to the test suite root inside
306 tests in the suite.
308 **suffixes** For **lit** test formats which scan directories for tests, this
309 variable is a list of suffixes to identify test files. Used by: *ShTest*.
311 **substitutions** For **lit** test formats which substitute variables into a test
318 containing the test suite, or None.
320 **root** The root configuration. This is the top-most :program:`lit` configuration in
323 **pipefail** Normally a test using a shell pipe fails if any of the commands
325 makes the test fail only if the last command in the pipe fails.
327 TEST DISCOVERY
330 Once test suites are located, :program:`lit` recursively traverses the source
332 enters a sub-directory, it first checks to see if a nested test suite is
333 defined in that directory. If so, it loads that test suite recursively,
334 otherwise it instantiates a local test config for the directory (see
335 :ref:`local-configuration-files`).
337 Tests are identified by the test suite they are contained within, and the
338 relative path inside that suite. Note that the relative path may not refer to
339 an actual file on disk; some test formats (such as *GoogleTest*) define
341 test file and a subpath to identify the virtual test.
343 .. _local-configuration-files:
348 When :program:`lit` loads a subdirectory in a test suite, it instantiates a
349 local test configuration by cloning the configuration for the parent directory
350 --- the root of this configuration chain will always be a test suite. Once the
351 test configuration is cloned :program:`lit` checks for a *lit.local.cfg* file
355 configuration parameters --- for example, to change the test format, or the
356 suffixes which identify test files.
358 PRE-DEFINED SUBSTITUTIONS
371 %t temporary file name unique to the test
372 %T temporary directory unique to the test
381 Further substitution patterns might be defined by each test module.
382 See the modules :ref:`local-configuration-files`.
387 TEST RUN OUTPUT FORMAT
390 The :program:`lit` output for a test run conforms to the following schema, in
396 Each test result is expected to appear on a line that matches:
398 .. code-block:: none
400 <result code>: <test name> (<progress info>)
402 where ``<result-code>`` is a standard test result such as PASS, FAIL, XFAIL,
406 The ``<test name>`` field can consist of an arbitrary string containing no
412 Each test result may include additional (multiline) log information in the
415 .. code-block:: none
417 <log delineator> TEST '(<test name>)' <trailing delineator>
421 where ``<test name>`` should be the name of a preceding reported test, ``<log
426 The following is an example of a test run output which consists of four tests A,
427 B, C, and D, and a log message for the failing test C:
429 .. code-block:: none
434 ******************** TEST 'C' FAILED ********************
435 Test 'C' failed as a result of exit code 1.
443 test suites in the *ExampleTests* directory.
446 --------