Skip to content

[docs] Add some useful lit commandline flags to the Testing documentation. #10757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions docs/Testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ For every target above, there are variants for different optimizations:
``check-swift-non-executable-iphoneos-arm64``) -- runs tests not marked with
``executable_test`` in ``-Onone`` mode.

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

.. code-block:: bash

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

Extra lit.py invocation options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* ``-s`` reduces the amount of output that lit shows.

* ``-v`` causes a test's commandline and output to be printed if the test fails.

* ``-a`` causes a test's commandline and output to always be printed.

* ``--filter=<pattern>`` causes only tests with paths matching the given regular
expression to be run.

* ``-i`` causes tests that have a newer modification date and failing tests to
be run first. This is implemented by updating the mtimes of the tests.

* ``--no-execute`` causes a dry run to be performed. *NOTE* This means that all
tests are assumed to PASS.

* ``--time-tests`` will cause elapsed wall time to be tracked for each test.

* ``--timeout=<MAXINDIVIDUALTESTTIME>`` sets a maximum time that can be spent
running a single test (in seconds). 0 (the default means no time limit.

* ``--max-failures=<MAXFAILURES>`` stops execution after ``MAXFAILURES`` number
of failures.

* ``--param gmalloc`` will run all tests under Guard Malloc (macOS only). See
``man libgmalloc`` for more information.

Expand Down