Skip to content

[lldb] Correct documentation of LLDB_TEST_USER_ARGS #89042

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
Apr 18, 2024
Merged
Show file tree
Hide file tree
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
25 changes: 21 additions & 4 deletions lldb/docs/resources/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -441,23 +441,40 @@ Running the Full Test Suite
The easiest way to run the LLDB test suite is to use the ``check-lldb`` build
target.

::

$ ninja check-lldb

Changing Test Suite Options
```````````````````````````

By default, the ``check-lldb`` target builds the test programs with the same
compiler that was used to build LLDB. To build the tests with a different
compiler, you can set the ``LLDB_TEST_COMPILER`` CMake variable.

You can also add to the test runner options by setting the
``LLDB_TEST_USER_ARGS`` CMake variable. This variable uses ``;`` to separate
items which must be separate parts of the runner's command line.

It is possible to customize the architecture of the test binaries and compiler
used by appending ``-A`` and ``-C`` options respectively to the CMake variable
``LLDB_TEST_USER_ARGS``. For example, to test LLDB against 32-bit binaries
built with a custom version of clang, do:
used by appending ``-A`` and ``-C`` options respectively. For example, to test
LLDB against 32-bit binaries built with a custom version of clang, do:

::

$ cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G Ninja
$ cmake -DLLDB_TEST_USER_ARGS="-A;i386;-C;/path/to/custom/clang" -G Ninja
$ ninja check-lldb

Note that multiple ``-A`` and ``-C`` flags can be specified to
``LLDB_TEST_USER_ARGS``.

If you want to change the LLDB settings that tests run with then you can set
the ``--setting`` option of the test runner via this same variable. For example
``--setting;target.disable-aslr=true``.

For a full list of test runner options, see
``<build-dir>/bin/lldb-dotest --help``.

Running a Single Test Suite
```````````````````````````

Expand Down
3 changes: 2 additions & 1 deletion lldb/test/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ set(LLDB_TEST_ARCH
# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script
set(LLDB_TEST_USER_ARGS
""
CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'")
CACHE STRING "Specify additional arguments to pass to test runner. Seperate \
items with \";\". For example: '-C;gcc;-C;clang;-A;i386;-A;x86_64'")

set(LLDB_TEST_COMMON_ARGS_VAR
-u CXXFLAGS
Expand Down