|
1 | 1 | Testing
|
2 | 2 | =======
|
3 | 3 |
|
4 |
| -The LLDB test suite consists of Python scripts located under the test |
5 |
| -directory. Each script contains a number of test cases and is usually |
6 |
| -accompanied by a C (C++, ObjC, etc.) source file. Each test first compiles the |
7 |
| -source file and then uses LLDB to debug the resulting executable. The tests |
8 |
| -verify both the LLDB command line interface and the scripting API. |
| 4 | +The LLDB test suite consists of three different kinds of test: |
| 5 | + |
| 6 | +* Python scripts located under ``lldb/packages/Python/lldbsuite``. |
| 7 | + These are written using python's unittest2 testing framework. |
| 8 | + |
| 9 | +* Unit tests, located under ``lldb/unittests``. These are written in C++, |
| 10 | + using googletest. |
| 11 | + |
| 12 | +* LIT tests, located under ``lldb/lit``. These use the LLVM Integrated Tester. |
| 13 | + |
| 14 | +Many of the tests are accompanied by a C (C++, ObjC, etc.) source file. Each test |
| 15 | +first compiles the source file and then uses LLDB to debug the resulting executable. |
| 16 | + |
| 17 | +The tests verify both the LLDB command line interface and the scripting API. |
9 | 18 |
|
10 | 19 | .. contents::
|
11 | 20 | :local:
|
@@ -46,8 +55,8 @@ Note that multiple ``-A`` and ``-C`` flags can be specified to
|
46 | 55 | ``LLDB_TEST_USER_ARGS``.
|
47 | 56 |
|
48 | 57 |
|
49 |
| -Running a Specific Test or Set of Tests |
50 |
| ---------------------------------------- |
| 58 | +Running a Specific Test or Set of Tests: Python |
| 59 | +----------------------------------------------- |
51 | 60 |
|
52 | 61 | In addition to running all the LLDB test suites with the ``check-lldb`` CMake
|
53 | 62 | target above, it is possible to run individual LLDB tests. If you have a CMake
|
@@ -86,6 +95,44 @@ Many more options that are available. To see a list of all of them, run:
|
86 | 95 |
|
87 | 96 | > python dotest.py -h
|
88 | 97 |
|
| 98 | + |
| 99 | +Running a Specific Test or Set of Tests: Unit Tests |
| 100 | +--------------------------------------------------- |
| 101 | + |
| 102 | +The unit tests are simple executables, located in the build directory under ``tools/lldb/unittests``. |
| 103 | + |
| 104 | +To run them, just run the test binary, for example, to run all the Host tests: |
| 105 | + |
| 106 | +:: |
| 107 | + |
| 108 | + > ./tools/lldb/unittests/Host/HostTests |
| 109 | + |
| 110 | + |
| 111 | +To run a specific test, pass a filter, for example: |
| 112 | + |
| 113 | +:: |
| 114 | + |
| 115 | + > ./tools/lldb/unittests/Host/HostTests --gtest_filter=SocketTest.DomainListenConnectAccept |
| 116 | + |
| 117 | + |
| 118 | +Running a Specific Test or Set of Tests: LIT |
| 119 | +-------------------------------------------- |
| 120 | + |
| 121 | +LIT automatically scans a directory for tests. To run a subset of the LIT tests, pass it a |
| 122 | +subdirectory, for example: |
| 123 | + |
| 124 | +:: |
| 125 | + |
| 126 | + > ./bin/llvm-lit -sv tools/lldb/lit/Commands/CommandScriptImmediateOutput |
| 127 | + |
| 128 | + |
| 129 | +LIT can also filter based on test name. |
| 130 | + |
| 131 | +:: |
| 132 | + |
| 133 | + > ./bin/llvm-lit -sv tools/lldb/lit --filter CommandScriptImmediateOutput |
| 134 | + |
| 135 | + |
89 | 136 | Running the Test Suite Remotely
|
90 | 137 | -------------------------------
|
91 | 138 |
|
|
0 commit comments