[lldb] Add assertStopReason helper function
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 3 Aug 2022 18:42:12 +0000 (11:42 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 3 Aug 2022 18:44:13 +0000 (11:44 -0700)
commit0f821339dad1bf45dd71a1cac32b6352ba251ecb
treea324aaed0dee45aad11f4d5972e18f98f70ebb2c
parent371610793491fcd1c9af114a0de0cdda9a4408b0
[lldb] Add assertStopReason helper function

Add a function to make it easier to debug a test failure caused by an
unexpected stop reason. This is similar to the assertState helper that
was added in ce825e46743b.

Before:

  self.assertEqual(stop_reason, lldb.eStopReasonInstrumentation)
  AssertionError: 5 != 10

After:

  self.assertStopReason(stop_reason, lldb.eStopReasonInstrumentation)
  AssertionError: signal (5) != instrumentation (10)

Differential revision: https://reviews.llvm.org/D131083
31 files changed:
lldb/docs/resources/test.rst
lldb/packages/Python/lldbsuite/test/lldbtest.py
lldb/packages/Python/lldbsuite/test/lldbutil.py
lldb/test/API/commands/process/continue_to_bkpt/TestContinueToBkpts.py
lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
lldb/test/API/commands/watchpoints/watchpoint_count/TestWatchpointCount.py
lldb/test/API/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py
lldb/test/API/functionalities/breakpoint/breakpoint_on_lambda_capture/TestBreakOnLambdaCapture.py
lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
lldb/test/API/functionalities/breakpoint/two_hits_one_actual/TestTwoHitsOneActual.py
lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py
lldb/test/API/functionalities/mtc/simple/TestMTCSimple.py
lldb/test/API/functionalities/postmortem/elf-core/gcore/TestGCore.py
lldb/test/API/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py
lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
lldb/test/API/functionalities/postmortem/wow64_minidump/TestWow64MiniDump.py
lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
lldb/test/API/functionalities/return-value/TestReturnValue.py
lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py
lldb/test/API/functionalities/thread/create_during_step/TestCreateDuringStep.py
lldb/test/API/functionalities/thread/num_threads/TestNumThreads.py
lldb/test/API/functionalities/thread/state/TestThreadStates.py
lldb/test/API/functionalities/thread/state_after_expression/TestStateAfterExpression.py
lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py
lldb/test/API/lang/c/stepping/TestStepAndBreakpoints.py
lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
lldb/test/API/python_api/thread/TestThreadAPI.py