This uses the same approach as the debug info tests to avoid needing to explicitly spell out the two kinds of tests. I convert a handful of tests to the new mechanism. The rest will be converted in follow-up patches.
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
|
|
# lldb test suite imports
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import TestBase
|
|
|
|
# gdb-remote-specific imports
|
|
import lldbgdbserverutils
|
|
from gdbremote_testcase import GdbRemoteTestCaseBase
|
|
|
|
|
|
class TestGdbRemoteExitCode(GdbRemoteTestCaseBase):
|
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
|
|
|
def _test_inferior_exit(self, retval):
|
|
self.build()
|
|
|
|
procs = self.prep_debug_monitor_and_inferior(
|
|
inferior_args=["retval:%d" % retval])
|
|
|
|
self.test_sequence.add_log_lines(
|
|
["read packet: $vCont;c#a8",
|
|
"send packet: $W{0:02x}#00".format(retval)],
|
|
True)
|
|
|
|
self.expect_gdbremote_sequence()
|
|
|
|
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
|
|
def test_inferior_exit_0(self):
|
|
self._test_inferior_exit(0)
|
|
|
|
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
|
|
def test_inferior_exit_42(self):
|
|
self._test_inferior_exit(42)
|