summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/event/TestEvents.py
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2015-05-08 00:43:28 +0000
committerSiva Chandra <sivachandra@google.com>2015-05-08 00:43:28 +0000
commit8a1f76936c45e5a529f29e50488e6755de8c53c2 (patch)
tree6d3e179438aa0995b50f41a34012cbfda4f1b4b1 /lldb/test/python_api/event/TestEvents.py
parent60310f2720b7f7b3b39ff3464479d498be17cb48 (diff)
downloadbcm5719-llvm-8a1f76936c45e5a529f29e50488e6755de8c53c2.tar.gz
bcm5719-llvm-8a1f76936c45e5a529f29e50488e6755de8c53c2.zip
[TestEvents] Add a 'connected' state to include remote debugging.
Test Plan: dotest.py -p TestEvents Reviewers: vharron, chaoren Reviewed By: chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9581 llvm-svn: 236800
Diffstat (limited to 'lldb/test/python_api/event/TestEvents.py')
-rw-r--r--lldb/test/python_api/event/TestEvents.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py
index 8a8ed48ef0f..86a34ba0cc9 100644
--- a/lldb/test/python_api/event/TestEvents.py
+++ b/lldb/test/python_api/event/TestEvents.py
@@ -247,11 +247,13 @@ class EventAPITestCase(TestBase):
# The finite state machine for our custom listening thread, with an
- # initail state of 0, which means a "running" event is expected.
- # It changes to 1 after "running" is received.
- # It cahnges to 2 after "stopped" is received.
- # 2 will be our final state and the test is complete.
- self.state = 0
+ # initail state of None, which means no event has been received.
+ # It changes to 'connected' after 'connected' event is received (for remote platforms)
+ # It changes to 'running' after 'running' event is received (should happen only if the
+ # currentstate is either 'None' or 'connected')
+ # It changes to 'stopped' if a 'stopped' event is received (should happen only if the
+ # current state is 'running'.)
+ self.state = None
# Create MyListeningThread to wait for state changed events.
# By design, a "running" event is expected following by a "stopped" event.
@@ -272,12 +274,20 @@ class EventAPITestCase(TestBase):
match = pattern.search(desc)
if not match:
break;
- if self.context.state == 0 and match.group(1) == 'running':
- self.context.state = 1
+ if match.group(1) == 'connected':
+ # When debugging remote targets with lldb-server, we
+ # first get the 'connected' event.
+ self.context.assertTrue(self.context.state == None)
+ self.context.state = 'connected'
continue
- elif self.context.state == 1 and match.group(1) == 'stopped':
+ elif match.group(1) == 'running':
+ self.context.assertTrue(self.context.state == None or self.context.state == 'connected')
+ self.context.state = 'running'
+ continue
+ elif match.group(1) == 'stopped':
+ self.context.assertTrue(self.context.state == 'running')
# Whoopee, both events have been received!
- self.context.state = 2
+ self.context.state = 'stopped'
break
else:
break
@@ -304,7 +314,7 @@ class EventAPITestCase(TestBase):
my_thread.join()
# The final judgement. :-)
- self.assertTrue(self.state == 2,
+ self.assertTrue(self.state == 'stopped',
"Both expected state changed events received")
OpenPOWER on IntegriCloud