[Lldb-commits] [lldb] r122382 - /lldb/trunk/test/python_api/event/TestEvents.py
Johnny Chen
johnny.chen at apple.com
Tue Dec 21 16:56:47 PST 2010
Author: johnny
Date: Tue Dec 21 18:56:47 2010
New Revision: 122382
URL: http://llvm.org/viewvc/llvm-project?rev=122382&view=rev
Log:
Fix some typos in the docstrings and also update the test method names.
Modified:
lldb/trunk/test/python_api/event/TestEvents.py
Modified: lldb/trunk/test/python_api/event/TestEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/event/TestEvents.py?rev=122382&r1=122381&r2=122382&view=diff
==============================================================================
--- lldb/trunk/test/python_api/event/TestEvents.py (original)
+++ lldb/trunk/test/python_api/event/TestEvents.py Tue Dec 21 18:56:47 2010
@@ -27,16 +27,16 @@
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
- def test_broadcast_event_with_dsym(self):
- """Exercise SBBroadcaster.BroadcastEvent() API."""
+ def test_add_listener_to_broadcaster_dsym(self):
+ """Exercise some SBBroadcaster APIs."""
self.buildDsym()
- self.do_broadcast_event()
+ self.do_add_listener_to_broadcaster()
@python_api_test
- def test_broadcast_event_with_dwarf(self):
- """Exercise SBBroadcaster.BroadcastEvent() API."""
+ def test_add_listener_to_broadcaster_dwarf(self):
+ """Exercise some SBBroadcaster APIs."""
self.buildDwarf()
- self.do_broadcast_event()
+ self.do_add_listener_to_broadcaster()
def setUp(self):
# Call super's setUp().
@@ -80,14 +80,11 @@
import threading
class MyListeningThread(threading.Thread):
def run(self):
- #print "Running MyListeningThread:", self
count = 0
# Let's only try at most 3 times to retrieve any kind of event.
while not count > 3:
if listener.WaitForEvent(5, event):
#print "Got a valid event:", event
- #print "Event type:", event.GetType()
- #print "Event broadcaster:", event.GetBroadcaster().GetName()
return
count = count + 1
print "Timeout: listener.WaitForEvent"
@@ -108,8 +105,8 @@
self.assertTrue(event.IsValid(),
"My listening thread successfully received an event")
- def do_broadcast_event(self):
- """Get the broadcaster associated with the process and exercise BroadcastEvent API."""
+ def do_add_listener_to_broadcaster(self):
+ """Get the broadcaster associated with the process and wait for broadcaster events."""
exe = os.path.join(os.getcwd(), "a.out")
# Create a target by the debugger.
@@ -163,11 +160,13 @@
# Let's only try at most 6 times to retrieve our events.
count = 0
while True:
- if listener.WaitForEvent(5, event):
+ if listener.WaitForEventForBroadcasterWithType(5,
+ broadcaster,
+ lldb.SBProcess.eBroadcastBitStateChanged,
+ event):
stream = lldb.SBStream()
event.GetDescription(stream)
description = stream.GetData()
- #print "Event data flavor:", event.GetDataFlavor()
#print "Event description:", description
match = pattern.search(description)
if not match:
More information about the lldb-commits
mailing list