Skip to content

Commit 0b0d221

Browse files
authored
Merge pull request #10757 from gottesmm/lit_doc_improvements
2 parents 57f6a63 + 25b25bb commit 0b0d221

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

docs/Testing.rst

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ For every target above, there are variants for different optimizations:
122122
``check-swift-non-executable-iphoneos-arm64``) -- runs tests not marked with
123123
``executable_test`` in ``-Onone`` mode.
124124

125-
If you need to manually run certain tests, you can invoke LLVM's lit.py script
126-
directly. For example:
125+
If more control is required (e.g. to manually run certain tests), you can invoke
126+
LLVM's lit.py script directly. For example:
127127

128128
.. code-block:: bash
129129
@@ -148,11 +148,34 @@ regardless of location.
148148
For more complicated configuration, copy the invocation from one of the build
149149
targets mentioned above and modify it as necessary. lit.py also has several
150150
useful features, like timing tests and providing a timeout. Check these features
151-
out with ``lit.py -h``.
151+
out with ``lit.py -h``. We document some of the more useful ones below:
152152

153153
Extra lit.py invocation options
154154
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155155

156+
* ``-s`` reduces the amount of output that lit shows.
157+
158+
* ``-v`` causes a test's commandline and output to be printed if the test fails.
159+
160+
* ``-a`` causes a test's commandline and output to always be printed.
161+
162+
* ``--filter=<pattern>`` causes only tests with paths matching the given regular
163+
expression to be run.
164+
165+
* ``-i`` causes tests that have a newer modification date and failing tests to
166+
be run first. This is implemented by updating the mtimes of the tests.
167+
168+
* ``--no-execute`` causes a dry run to be performed. *NOTE* This means that all
169+
tests are assumed to PASS.
170+
171+
* ``--time-tests`` will cause elapsed wall time to be tracked for each test.
172+
173+
* ``--timeout=<MAXINDIVIDUALTESTTIME>`` sets a maximum time that can be spent
174+
running a single test (in seconds). 0 (the default means no time limit.
175+
176+
* ``--max-failures=<MAXFAILURES>`` stops execution after ``MAXFAILURES`` number
177+
of failures.
178+
156179
* ``--param gmalloc`` will run all tests under Guard Malloc (macOS only). See
157180
``man libgmalloc`` for more information.
158181

0 commit comments

Comments
 (0)