llvm-project/lldb/test/API/functionalities/reverse-execution/TestReverseExecutionNotSupported.py
Michael Buch 9147569c7f [lldb][test] Rename reverse-execution/TestReverseContinueNotSupported.py
Otherwise `lldb-dotest` fails with:
```
Traceback (most recent call last):
  File "/Users/jonas/Git/llvm-worktrees/llvm-project/lldb/test/API/dotest.py", line 8, in <module>
    lldbsuite.test.run_suite()
  File "/Users/jonas/Git/llvm-worktrees/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 1063, in run_suite
    visit("Test", dirpath, filenames)
  File "/Users/jonas/Git/llvm-worktrees/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 701, in visit
    raise Exception("Found multiple tests with the name %s" % name)
Exception: Found multiple tests with the name TestReverseContinueNotSupported.py
```
2025-04-25 14:26:50 +01:00

36 lines
1.3 KiB
Python

import lldb
import unittest
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbsuite.test import lldbutil
class TestReverseExecutionNotSupported(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def test_reverse_execution_not_supported(self):
self.build()
exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
main_bkpt = target.BreakpointCreateByName("main", None)
self.assertTrue(main_bkpt, VALID_BREAKPOINT)
process = target.LaunchSimple(None, None, self.get_process_working_directory())
self.assertTrue(process, PROCESS_IS_VALID)
# This will fail gracefully.
status = process.ContinueInDirection(lldb.eRunReverse)
self.assertFailure(status)
# Where gdb-remote is used this starts with "error: gdb-remote" but on Windows it says "error: windows".
self.assertTrue(
status.GetCString().endswith(
" does not support reverse execution of processes"
)
)
self.assertSuccess(process.ContinueInDirection(lldb.eRunForward))
self.assertState(process.GetState(), lldb.eStateExited)
self.assertEqual(process.GetExitStatus(), 0)