[Lldb-commits] [lldb] r372797 - [Documentation] Expand on testing variants.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 24 17:58:40 PDT 2019


Author: jdevlieghere
Date: Tue Sep 24 17:58:39 2019
New Revision: 372797

URL: http://llvm.org/viewvc/llvm-project?rev=372797&view=rev
Log:
[Documentation] Expand on testing variants.

The testing documentation appears to be from an era when the only kind
of tests were the lldbsuite python tests. This patch adds a short
description of the unittests and LIT tests and how to run them.

Patch by: Lawrence D'Anna

Differential revision: https://reviews.llvm.org/D67943

Modified:
    lldb/trunk/docs/resources/test.rst

Modified: lldb/trunk/docs/resources/test.rst
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/test.rst?rev=372797&r1=372796&r2=372797&view=diff
==============================================================================
--- lldb/trunk/docs/resources/test.rst (original)
+++ lldb/trunk/docs/resources/test.rst Tue Sep 24 17:58:39 2019
@@ -1,11 +1,20 @@
 Testing
 =======
 
-The LLDB test suite consists of Python scripts located under the test
-directory. Each script contains a number of test cases and is usually
-accompanied by a C (C++, ObjC, etc.) source file. Each test first compiles the
-source file and then uses LLDB to debug the resulting executable. The tests
-verify both the LLDB command line interface and the scripting API.
+The LLDB test suite consists of three different kinds of test:
+
+* Python scripts located under ``lldb/packages/Python/lldbsuite``.
+  These are written using python's unittest2 testing framework.
+
+* Unit tests, located under ``lldb/unittests``.   These are written in C++,
+  using googletest.
+
+* LIT tests, located under ``lldb/lit``.  These use the LLVM Integrated Tester.
+
+Many of the tests are accompanied by a C (C++, ObjC, etc.) source file. Each test
+first compiles the source file and then uses LLDB to debug the resulting executable.
+
+The tests verify both the LLDB command line interface and the scripting API.
 
 .. contents::
    :local:
@@ -46,8 +55,8 @@ Note that multiple ``-A`` and ``-C`` fla
 ``LLDB_TEST_USER_ARGS``.
 
 
-Running a Specific Test or Set of Tests
----------------------------------------
+Running a Specific Test or Set of Tests: Python
+-----------------------------------------------
 
 In addition to running all the LLDB test suites with the ``check-lldb`` CMake
 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
 
    > python dotest.py -h
 
+
+Running a Specific Test or Set of Tests: Unit Tests
+---------------------------------------------------
+
+The unit tests are simple executables, located in the build directory under ``tools/lldb/unittests``.
+
+To run them, just run the test binary, for example, to run all the Host tests:
+
+::
+
+   > ./tools/lldb/unittests/Host/HostTests
+
+
+To run a specific test, pass a filter, for example:
+
+::
+
+   > ./tools/lldb/unittests/Host/HostTests --gtest_filter=SocketTest.DomainListenConnectAccept
+
+
+Running a Specific Test or Set of Tests: LIT
+--------------------------------------------
+
+LIT automatically scans a directory for tests.   To run a subset of the LIT tests, pass it a
+subdirectory, for example:
+
+::
+
+   > ./bin/llvm-lit -sv tools/lldb/lit/Commands/CommandScriptImmediateOutput
+
+
+LIT can also filter based on test name.
+
+::
+
+   > ./bin/llvm-lit -sv tools/lldb/lit --filter CommandScriptImmediateOutput
+
+
 Running the Test Suite Remotely
 -------------------------------
 




More information about the lldb-commits mailing list