JDevlieghere updated this revision to Diff 435372.
JDevlieghere added a comment.

Implement Ismail's suggestion:

  AssertionError: stopped (5) != exited (10) : Got exit event


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127355/new/

https://reviews.llvm.org/D127355

Files:
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  
lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
  
lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
  
lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
  lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
  
lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
  lldb/test/API/functionalities/completion/TestCompletion.py
  
lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
  lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
  lldb/test/API/functionalities/return-value/TestReturnValue.py
  lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
  lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
  lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
  lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
  lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
  lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
  lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
  lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
  lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
  lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
  lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
  lldb/test/API/python_api/objc_type/TestObjCType.py
  lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
  lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py

Index: lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
===================================================================
--- lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
+++ lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
@@ -27,7 +27,7 @@
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
Index: lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
===================================================================
--- lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
+++ lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
@@ -59,7 +59,7 @@
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -136,7 +136,7 @@
         # Now continue.
         process.Continue()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -169,7 +169,7 @@
 
         process.Continue()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
Index: lldb/test/API/python_api/objc_type/TestObjCType.py
===================================================================
--- lldb/test/API/python_api/objc_type/TestObjCType.py
+++ lldb/test/API/python_api/objc_type/TestObjCType.py
@@ -39,7 +39,7 @@
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
Index: lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
===================================================================
--- lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
+++ lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
@@ -45,7 +45,7 @@
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
Index: lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
===================================================================
--- lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -36,8 +36,8 @@
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         self.runCmd("add-dsym " +
                     self.getBuildArtifact("hide.app/Contents/a.out.dSYM"))
Index: lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
===================================================================
--- lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
@@ -79,8 +79,8 @@
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                          STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         self.runCmd(command)
         self.expect("frame select", substrs=['a.out`main at main.c'])
Index: lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
===================================================================
--- lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
+++ lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
@@ -30,8 +30,8 @@
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         frame = self.process.GetThreadAtIndex(0).GetFrameAtIndex(0)
         x = frame.FindVariable("x")
Index: lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
===================================================================
--- lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
+++ lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
@@ -33,8 +33,8 @@
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         exe_module = self.target.GetModuleAtIndex(0)
 
Index: lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
===================================================================
--- lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
+++ lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
@@ -47,8 +47,8 @@
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
             process, main_bkpt)
Index: lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
===================================================================
--- lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
+++ lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
@@ -63,8 +63,8 @@
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
             process, main_before_setProperty_bkpt)
Index: lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
===================================================================
--- lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
+++ lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
@@ -41,8 +41,8 @@
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         var = self.frame().FindVariable("foo")
         var_ptr_type = var.GetType()
Index: lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
===================================================================
--- lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -34,8 +34,8 @@
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         self.expect(
             'frame variable --ptr-depth=1 --show-types -d run -- object',
Index: lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
===================================================================
--- lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
+++ lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
@@ -38,7 +38,7 @@
         self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
 
         # Get the thread of the process
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
Index: lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
===================================================================
--- lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
+++ lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -61,8 +61,8 @@
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
             process, first_call_bpt)
Index: lldb/test/API/functionalities/return-value/TestReturnValue.py
===================================================================
--- lldb/test/API/functionalities/return-value/TestReturnValue.py
+++ lldb/test/API/functionalities/return-value/TestReturnValue.py
@@ -62,7 +62,7 @@
 
         thread.StepOut()
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         frame = thread.GetFrameAtIndex(0)
@@ -94,7 +94,7 @@
 
         thread.StepOutOfFrame(frame)
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
         frame = thread.GetFrameAtIndex(0)
         fun_name = frame.GetFunctionName()
@@ -123,7 +123,7 @@
         in_float = float(in_value.GetValue())
         thread.StepOut()
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         frame = thread.GetFrameAtIndex(0)
@@ -263,7 +263,7 @@
 
         thread.StepOut()
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         # Assuming all these functions step out to main.  Could figure out the caller dynamically
Index: lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
===================================================================
--- lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
+++ lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
@@ -63,7 +63,7 @@
     def test_stop_remote_platform_async(self):
         self.do_test_stop_at_entry(False, True)
 
-    def do_test_stop_at_entry(self, synchronous, remote):        
+    def do_test_stop_at_entry(self, synchronous, remote):
         """Test the normal launch path in either sync or async mode"""
         self.build()
 
@@ -98,7 +98,7 @@
             result = listener.WaitForEvent(30, event)
             self.assertTrue(result, "Timed out waiting for event from process")
             state = lldb.SBProcess.GetStateFromEvent(event)
-            self.assertEqual(state, lldb.eStateStopped, "Didn't get a stopped state after launch")
+            self.assertState(state, lldb.eStateStopped, "Didn't get a stopped state after launch")
 
         # Okay, we should be stopped.  Make sure we are indeed at the
         # entry point.  I only know how to do this on darwin:
@@ -127,13 +127,13 @@
                 self.assertTrue(result, "Timed out waiting for running")
                 state = lldb.SBProcess.GetStateFromEvent(event)
                 if num_running == 1:
-                    self.assertEqual(state, lldb.eStateRunning, "Got running event")
+                    self.assertState(state, lldb.eStateRunning, "Got running event")
             # The last event we should get is the exited event
-            self.assertEqual(state, lldb.eStateExited, "Got running event")
+            self.assertState(state, lldb.eStateExited, "Got exit event")
         else:
             # Make sure that the process has indeed exited
             state = process.GetState()
-            self.assertEqual(state, lldb.eStateExited);
+            self.assertState(state, lldb.eStateExited);
 
     def setup_remote_platform(self):
         return
Index: lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
===================================================================
--- lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
+++ lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
@@ -65,8 +65,8 @@
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         b = self.frame().FindVariable("b").GetDynamicValue(lldb.eDynamicCanRunTarget)
         self.assertEquals(b.GetNumChildren(), 0, "b has 0 children")
Index: lldb/test/API/functionalities/completion/TestCompletion.py
===================================================================
--- lldb/test/API/functionalities/completion/TestCompletion.py
+++ lldb/test/API/functionalities/completion/TestCompletion.py
@@ -43,7 +43,7 @@
 
         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
                                           '// Break here', self.main_source_spec)
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
 
         # Since CommandInterpreter has been corrected to update the current execution
         # context at the beginning of HandleCompletion, we're here explicitly testing
Index: lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
===================================================================
--- lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
+++ lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
@@ -71,7 +71,7 @@
         while True:
             self.thread.StepInstruction(True)
             step_count = step_count + 1
-            self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+            self.assertState(self.process.GetState(), lldb.eStateStopped)
             self.assertTrue(self.thread.GetStopReason() == lldb.eStopReasonPlanComplete or
                             self.thread.GetStopReason() == lldb.eStopReasonBreakpoint)
             if (self.thread.GetStopReason() == lldb.eStopReasonBreakpoint) :
@@ -83,24 +83,24 @@
 
         # Run the process until termination
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateExited)
+        self.assertState(self.process.GetState(), lldb.eStateExited)
 
     @skipIf(bugnumber="llvm.org/pr31972", hostoslist=["windows"])
     def test_step_over(self):
 
         self.thread.StepOver()
         # We should be stopped at the breakpoint_2 line with stop plan complete reason
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         self.thread.StepOver()
         # We should be stopped at the breakpoint_3 line with stop plan complete reason
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         self.thread.StepOver()
         # We should be stopped at the breakpoint_4
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonBreakpoint)
         thread1 = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, self.breakpoint4)
         self.assertEquals(self.thread, thread1, "Didn't stop at breakpoint 4.")
@@ -113,5 +113,5 @@
 
         # Run the process until termination
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateExited)
+        self.assertState(self.process.GetState(), lldb.eStateExited)
 
Index: lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
===================================================================
--- lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
+++ lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
@@ -32,7 +32,7 @@
         lldbutil.run_break_set_by_symbol(self, 'main', sym_exact=True)
         environment = self.registerSharedLibrariesWithTarget(target, ["foo"])
         process = target.LaunchSimple(None, environment, self.get_process_working_directory())
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
 
         # Regardless of the -m value the breakpoint should have exactly one
         # location on the foo functions
Index: lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
===================================================================
--- lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
+++ lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
@@ -37,7 +37,7 @@
     def finish_test(self):
         # Run the process until termination
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateExited)
+        self.assertState(self.process.GetState(), lldb.eStateExited)
 
     @no_debug_info_test
     def test_continue(self):
@@ -45,7 +45,7 @@
         self.prepare_test()
 
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         # We should be stopped at the second breakpoint
         self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(
             self.process, self.breakpoint2)
@@ -63,7 +63,7 @@
         step_over = False
         self.thread.StepInstruction(step_over)
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(
             self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(
                 self.target), self.bkpt_address.GetLoadAddress(
@@ -90,7 +90,7 @@
         step_over = False
         self.thread.StepInstruction(step_over)
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(
             self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(
                 self.target), self.bkpt_address.GetLoadAddress(
Index: lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
===================================================================
--- lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
+++ lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -36,8 +36,8 @@
         process = target.LaunchSimple(None, None,
                                       self.get_process_working_directory())
         self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         thread = lldbutil.get_stopped_thread(process,
                                              lldb.eStopReasonBreakpoint)
@@ -63,8 +63,8 @@
         self.assertEquals(thread.GetStopDescription(20), 'watchpoint 1')
 
         process.Continue()
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         self.assertEquals(thread.GetStopDescription(20), 'step over')
 
         self.step_inst_for_watchpoint(1)
@@ -90,8 +90,8 @@
         self.assertEquals(thread.GetStopDescription(20), 'watchpoint 2')
 
         process.Continue()
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         self.assertEquals(thread.GetStopDescription(20), 'step over')
 
         self.step_inst_for_watchpoint(2)
Index: lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
===================================================================
--- lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
+++ lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
@@ -41,8 +41,8 @@
 
         process = self.process()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         thread = process.GetThreadAtIndex(0)
 
@@ -72,8 +72,8 @@
 
         process = self.process()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         thread = process.GetThreadAtIndex(0)
 
@@ -95,8 +95,8 @@
 
         process = self.process()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         thread = process.GetThreadAtIndex(0)
 
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -519,9 +519,9 @@
         # /abs/path/to/packages/group/subdir/mytest.py -> group/subdir
         lldb_test_src = configuration.test_src_root
         if not test_file.startswith(lldb_test_src):
-          raise Exception(
-              "Test file '%s' must reside within lldb_test_src "
-              "(which is '%s')." % (test_file, lldb_test_src))
+            raise Exception(
+                "Test file '%s' must reside within lldb_test_src "
+                "(which is '%s')." % (test_file, lldb_test_src))
         return os.path.dirname(os.path.relpath(test_file, start=lldb_test_src))
 
     def TraceOn(self):
@@ -2474,6 +2474,14 @@
             self.fail(self._formatMessage(msg,
                 "'{}' is not success".format(error)))
 
+    """Assert two states are equal"""
+    def assertState(self, first, second, msg=None):
+        if first != second:
+            error = "{} ({}) != {} ({})".format(
+                lldbutil.state_type_to_str(first), first,
+                lldbutil.state_type_to_str(second), second)
+            self.fail(self._formatMessage(msg, error))
+
     def createTestTarget(self, file_path=None, msg=None,
                          load_dependent_modules=True):
         """
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to