[Lldb-commits] [lldb] 6565580 - [lldb] Add table with custom LLDB asserts to the docs
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 9 09:15:06 PDT 2022
Author: Jonas Devlieghere
Date: 2022-06-09T09:14:56-07:00
New Revision: 6565580f1b40edf8d9339fa849f4a1778d8816a9
URL: https://github.com/llvm/llvm-project/commit/6565580f1b40edf8d9339fa849f4a1778d8816a9
DIFF: https://github.com/llvm/llvm-project/commit/6565580f1b40edf8d9339fa849f4a1778d8816a9.diff
LOG: [lldb] Add table with custom LLDB asserts to the docs
Add table with custom LLDB asserts to the documentation.
Differential revision: https://reviews.llvm.org/D127410
Added:
Modified:
lldb/docs/resources/test.rst
Removed:
################################################################################
diff --git a/lldb/docs/resources/test.rst b/lldb/docs/resources/test.rst
index 258a8083baca8..001803dc5d284 100644
--- a/lldb/docs/resources/test.rst
+++ b/lldb/docs/resources/test.rst
@@ -320,9 +320,20 @@ A better way to write the test above would be using LLDB's testing function
several expressive asserts such as `self.assertIn` that automatically
generate an explanation how the received values
diff er from the expected
ones. Check the documentation of Python's `unittest` module to see what
- asserts are available. If you can't find a specific assert that fits your
- needs and you fall back to a generic assert, make sure you put useful
- information into the assert's `msg` argument that helps explain the failure.
+ asserts are available. LLDB also has a few custom asserts that are tailored
+ to our own data types.
+
++-----------------------------------------------+---------------------------------------------------------------+
+| **Assert** | **Description** |
++-----------------------------------------------+---------------------------------------------------------------+
+| ``assertSuccess`` | Assert that an ``lldb.SBError`` is in the "success" state. |
++-----------------------------------------------+---------------------------------------------------------------+
+| ``assertState`` | Assert that two states (``lldb.eState*``) are equal. |
++-----------------------------------------------+---------------------------------------------------------------+
+
+ If you can't find a specific assert that fits your needs and you fall back
+ to a generic assert, make sure you put useful information into the assert's
+ `msg` argument that helps explain the failure.
::
More information about the lldb-commits
mailing list