Summary: Moves lldbsuite tests to lldb/test/API.
This is a largely mechanical change, moved with the following steps:
```
rm lldb/test/API/testcases
mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}
mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner
for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done
```
lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.
Reviewers: labath, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71151
61 lines
2.1 KiB
Python
61 lines
2.1 KiB
Python
|
|
|
|
import gdbremote_testcase
|
|
import lldbgdbserverutils
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class TestGdbRemoteKill(gdbremote_testcase.GdbRemoteTestCaseBase):
|
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
|
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
|
|
|
|
def attach_commandline_kill_after_initial_stop(self):
|
|
reg_expr = r"^\$[XW][0-9a-fA-F]+([^#]*)#[0-9A-Fa-f]{2}"
|
|
procs = self.prep_debug_monitor_and_inferior()
|
|
self.test_sequence.add_log_lines([
|
|
"read packet: $k#6b",
|
|
{"direction": "send", "regex": reg_expr},
|
|
], True)
|
|
|
|
if self.stub_sends_two_stop_notifications_on_kill:
|
|
# Add an expectation for a second X result for stubs that send two
|
|
# of these.
|
|
self.test_sequence.add_log_lines([
|
|
{"direction": "send", "regex": reg_expr},
|
|
], True)
|
|
|
|
self.expect_gdbremote_sequence()
|
|
|
|
# Wait a moment for completed and now-detached inferior process to
|
|
# clear.
|
|
time.sleep(self._WAIT_TIMEOUT)
|
|
|
|
if not lldb.remote_platform:
|
|
# Process should be dead now. Reap results.
|
|
poll_result = procs["inferior"].poll()
|
|
self.assertIsNotNone(poll_result)
|
|
|
|
# Where possible, verify at the system level that the process is not
|
|
# running.
|
|
self.assertFalse(
|
|
lldbgdbserverutils.process_is_running(
|
|
procs["inferior"].pid, False))
|
|
|
|
@debugserver_test
|
|
def test_attach_commandline_kill_after_initial_stop_debugserver(self):
|
|
self.init_debugserver_test()
|
|
self.build()
|
|
self.set_inferior_startup_attach()
|
|
self.attach_commandline_kill_after_initial_stop()
|
|
|
|
@expectedFailureNetBSD
|
|
@llgs_test
|
|
def test_attach_commandline_kill_after_initial_stop_llgs(self):
|
|
self.init_llgs_test()
|
|
self.build()
|
|
self.set_inferior_startup_attach()
|
|
self.attach_commandline_kill_after_initial_stop()
|