[Lldb-commits] [lldb] [LLDB][SBProgress] Add a finalize method (PR #128966)

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 26 16:45:52 PST 2025


================
@@ -33,3 +33,17 @@ def test_without_external_bit_set(self):
         expected_string = "Test progress first increment"
         progress.Increment(1, expected_string)
         self.assertFalse(listener.PeekAtNextEvent(event))
+
+    def test_progress_finalize(self):
+        """Test SBProgress finalize sends the progressEnd event"""
+
+        progress = lldb.SBProgress("Test SBProgress", "Test finalize", self.dbg)
+        listener = lldb.SBListener("Test listener")
+        broadcaster = self.dbg.GetBroadcaster()
+        broadcaster.AddListener(listener, lldb.eBroadcastBitExternalProgressCategory)
+        event = lldb.SBEvent()
+        progress.Finalize()
+        self.assertTrue(listener.WaitForEvent(5, event))
----------------
Jlalond wrote:

Nope! Because we create the progress event before wiring up the listener we only listen for the end message.

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


More information about the lldb-commits mailing list