summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-01-26 01:19:50 +0000
committerZachary Turner <zturner@google.com>2016-01-26 01:19:50 +0000
commita37eac51de72484bf08cb0b1dc26745b6fa55637 (patch)
tree99ed8c9d9815dac198313352a5e59e383c4ff5c3 /lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
parentbca81c5a18e442767b4e08c2e73daadeaaa3e24d (diff)
downloadbcm5719-llvm-a37eac51de72484bf08cb0b1dc26745b6fa55637.tar.gz
bcm5719-llvm-a37eac51de72484bf08cb0b1dc26745b6fa55637.zip
Fix TestRerun.py on Windows.
This is another example of a test that was looking for the thread at index 0 instead of requesting the thread that was stopped at the created breakpoint. This assumption isn't true on Windows 10. llvm-svn: 258764
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py31
1 files changed, 6 insertions, 25 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py b/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
index 0ed56de3569..f9d45ae8731 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
@@ -31,19 +31,9 @@ class TestRerun(TestBase):
self.runCmd("process launch 1 2 3")
process = self.process()
-
- self.assertTrue(process.GetState() == lldb.eStateStopped,
- STOPPED_DUE_TO_BREAKPOINT)
-
- thread = process.GetThreadAtIndex (0)
-
- self.assertTrue (thread.IsValid(),
- "Process stopped at 'main' should have a valid thread");
-
- stop_reason = thread.GetStopReason()
-
- self.assertTrue (stop_reason == lldb.eStopReasonBreakpoint,
- "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint");
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint)
+ self.assertIsNotNone(thread, "Process should be stopped at a breakpoint in main")
+ self.assertTrue(thread.IsValid(), "Stopped thread is not valid")
self.expect("frame variable argv[1]", substrs=['1'])
self.expect("frame variable argv[2]", substrs=['2'])
@@ -57,19 +47,10 @@ class TestRerun(TestBase):
self.runCmd("process launch")
process = self.process()
-
- self.assertTrue(process.GetState() == lldb.eStateStopped,
- STOPPED_DUE_TO_BREAKPOINT)
-
- thread = process.GetThreadAtIndex (0)
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint)
- self.assertTrue (thread.IsValid(),
- "Process stopped at 'main' should have a valid thread");
-
- stop_reason = thread.GetStopReason()
-
- self.assertTrue (stop_reason == lldb.eStopReasonBreakpoint,
- "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint");
+ self.assertIsNotNone(thread, "Process should be stopped at a breakpoint in main");
+ self.assertTrue(thread.IsValid(), "Stopped thread is not valid")
self.expect("frame variable argv[1]", substrs=['1'])
self.expect("frame variable argv[2]", substrs=['2'])
OpenPOWER on IntegriCloud