[Lldb-commits] [lldb] A few updates around "transcript" (PR #92843)

via lldb-commits lldb-commits at lists.llvm.org
Mon May 20 19:48:44 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 85e1124049cd8aa1e58c101e082100ba74df7e42...67a1197a15682731f37890734a5c8674896e0428 lldb/test/API/commands/statistics/basic/TestStats.py lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- commands/statistics/basic/TestStats.py	2024-05-21 02:30:40.000000 +0000
+++ commands/statistics/basic/TestStats.py	2024-05-21 02:48:21.570474 +0000
@@ -622,34 +622,35 @@
 
         # Verify that the top level statistic that aggregates the number of
         # modules with debugInfoHadVariableErrors is greater than zero
         self.assertGreater(stats["totalModuleCountWithVariableErrors"], 0)
 
+
 def test_transcript(self):
-        """
-        Test "statistics dump" and the transcript information.
-        """
-        self.build()
-        exe = self.getBuildArtifact("a.out")
-        target = self.createTestTarget(file_path=exe)
-        self.runCmd("settings set target.save-transcript true")
-        self.runCmd("version")
-
-        # Verify the output of a first "statistics dump"
-        debug_stats = self.get_stats()
-        self.assertIn("transcript", debug_stats)
-        transcript = debug_stats["transcript"]
-        self.assertEqual(len(transcript), 2)
-        self.assertEqual(transcript[0]["command"], "version")
-        self.assertEqual(transcript[1]["command"], "statistics dump")
-        self.assertEqual(transcript[1]["output"], "")
-
-        # Verify the output of a second "statistics dump"
-        debug_stats = self.get_stats()
-        self.assertIn("transcript", debug_stats)
-        transcript = debug_stats["transcript"]
-        self.assertEqual(len(transcript), 3)
-        self.assertEqual(transcript[0]["command"], "version")
-        self.assertEqual(transcript[1]["command"], "statistics dump")
-        self.assertNotEqual(transcript[1]["output"], "")
-        self.assertEqual(transcript[2]["command"], "statistics dump")
-        self.assertEqual(transcript[2]["output"], "")
+    """
+    Test "statistics dump" and the transcript information.
+    """
+    self.build()
+    exe = self.getBuildArtifact("a.out")
+    target = self.createTestTarget(file_path=exe)
+    self.runCmd("settings set target.save-transcript true")
+    self.runCmd("version")
+
+    # Verify the output of a first "statistics dump"
+    debug_stats = self.get_stats()
+    self.assertIn("transcript", debug_stats)
+    transcript = debug_stats["transcript"]
+    self.assertEqual(len(transcript), 2)
+    self.assertEqual(transcript[0]["command"], "version")
+    self.assertEqual(transcript[1]["command"], "statistics dump")
+    self.assertEqual(transcript[1]["output"], "")
+
+    # Verify the output of a second "statistics dump"
+    debug_stats = self.get_stats()
+    self.assertIn("transcript", debug_stats)
+    transcript = debug_stats["transcript"]
+    self.assertEqual(len(transcript), 3)
+    self.assertEqual(transcript[0]["command"], "version")
+    self.assertEqual(transcript[1]["command"], "statistics dump")
+    self.assertNotEqual(transcript[1]["output"], "")
+    self.assertEqual(transcript[2]["command"], "statistics dump")
+    self.assertEqual(transcript[2]["output"], "")
--- python_api/interpreter/TestCommandInterpreterAPI.py	2024-05-21 02:42:42.000000 +0000
+++ python_api/interpreter/TestCommandInterpreterAPI.py	2024-05-21 02:48:21.667109 +0000
@@ -160,11 +160,14 @@
                 "error": "error: 'an-unknown-command' is not a valid command.\n",
             })
 
         # (lldb) br s -f main.c -l <line>
         self.assertEqual(transcript[2]["command"], "br s -f main.c -l %d" % self.line)
-        self.assertEqual(transcript[2]["resolvedCommand"], "breakpoint set -f main.c -l %d" % self.line)
+        self.assertEqual(
+            transcript[2]["resolvedCommand"],
+            "breakpoint set -f main.c -l %d" % self.line,
+        )
         # Breakpoint 1: where = a.out`main + 29 at main.c:5:3, address = 0x0000000100000f7d
         self.assertIn("Breakpoint 1: where = a.out`main ", transcript[2]["output"])
         self.assertEqual(transcript[2]["error"], "")
 
         # (lldb) r

``````````

</details>


https://github.com/llvm/llvm-project/pull/92843


More information about the lldb-commits mailing list