Remove manual test duplication.
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-
class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
AUXV_SUPPORT_FEATURE_NAME = "qXfer:auxv:read"
def has_auxv_support(self):
- inferior_args = ["message:main entered", "sleep:5"]
- procs = self.prep_debug_monitor_and_inferior(
- inferior_args=inferior_args)
-
- # Don't do anything until we match the launched inferior main entry output.
- # Then immediately interrupt the process.
- # This prevents auxv data being asked for before it's ready and leaves
- # us in a stopped state.
- self.test_sequence.add_log_lines([
- # Start the inferior...
- "read packet: $c#63",
- # ... match output....
- {"type": "output_match", "regex": self.maybe_strict_output_regex(
- r"message:main entered\r\n")},
- ], True)
- # ... then interrupt.
- self.add_interrupt_packets()
- self.add_qSupported_packets()
+ procs = self.prep_debug_monitor_and_inferior()
+ self.add_qSupported_packets()
context = self.expect_gdbremote_sequence()
self.assertIsNotNone(context)
self.assertIsNotNone(content_raw)
return (word_size, self.decode_gdbremote_binary(content_raw))
- def supports_auxv(self):
- # When non-auxv platforms support llgs, skip the test on platforms
- # that don't support auxv.
+ @skipIfWindows # no auxv support.
+ @skipIfDarwin
+ def test_supports_auxv(self):
+ self.build()
+ self.set_inferior_startup_launch()
self.assertTrue(self.has_auxv_support())
- #
- # We skip the "supports_auxv" test on debugserver. The rest of the tests
- # appropriately skip the auxv tests if the support flag is not present
- # in the qSupported response, so the debugserver test bits are still there
- # in case debugserver code one day does have auxv support and thus those
- # tests don't get skipped.
- #
-
- @skipIfWindows # no auxv support.
- @llgs_test
- def test_supports_auxv_llgs(self):
+ @skipIfWindows
+ @expectedFailureNetBSD
+ def test_auxv_data_is_correct_size(self):
self.build()
self.set_inferior_startup_launch()
- self.supports_auxv()
- def auxv_data_is_correct_size(self):
(word_size, auxv_data) = self.get_raw_auxv_data()
self.assertIsNotNone(auxv_data)
self.assertEqual(len(auxv_data) % (2 * word_size), 0)
self.trace("auxv contains {} entries".format(len(auxv_data) / (2*word_size)))
- @debugserver_test
- def test_auxv_data_is_correct_size_debugserver(self):
- self.build()
- self.set_inferior_startup_launch()
- self.auxv_data_is_correct_size()
-
@skipIfWindows
@expectedFailureNetBSD
- @llgs_test
- def test_auxv_data_is_correct_size_llgs(self):
+ def test_auxv_keys_look_valid(self):
self.build()
self.set_inferior_startup_launch()
- self.auxv_data_is_correct_size()
- def auxv_keys_look_valid(self):
(word_size, auxv_data) = self.get_raw_auxv_data()
self.assertIsNotNone(auxv_data)
self.assertTrue(auxv_key <= 1000)
self.trace("auxv dict: {}".format(auxv_dict))
- @debugserver_test
- def test_auxv_keys_look_valid_debugserver(self):
- self.build()
- self.set_inferior_startup_launch()
- self.auxv_keys_look_valid()
-
@skipIfWindows
@expectedFailureNetBSD
- @llgs_test
- def test_auxv_keys_look_valid_llgs(self):
+ def test_auxv_chunked_reads_work(self):
self.build()
self.set_inferior_startup_launch()
- self.auxv_keys_look_valid()
- def auxv_chunked_reads_work(self):
# Verify that multiple smaller offset,length reads of auxv data
# return the same data as a single larger read.
# Verify both types of data collection returned same content.
self.assertEqual(auxv_dict_iterated, auxv_dict)
-
- @debugserver_test
- def test_auxv_chunked_reads_work_debugserver(self):
- self.build()
- self.set_inferior_startup_launch()
- self.auxv_chunked_reads_work()
-
- @skipIfWindows
- @expectedFailureNetBSD
- @llgs_test
- def test_auxv_chunked_reads_work_llgs(self):
- self.build()
- self.set_inferior_startup_launch()
- self.auxv_chunked_reads_work()
import xml.etree.ElementTree as ET
-
import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-
class TestGdbRemoteLibrariesSvr4Support(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
for lib in self.get_expected_libs():
self.assertIn(os.path.realpath(self.getBuildDir() + "/" + lib), libraries_svr4_names)
- @llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
def test_supports_libraries_svr4(self):
self.setup_test()
self.assertTrue(self.has_libraries_svr4_support())
- @llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
@expectedFailureNetBSD
def test_libraries_svr4_well_formed(self):
self.setup_test()
self.libraries_svr4_well_formed()
- @llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
@expectedFailureNetBSD
def test_libraries_svr4_load_addr(self):
self.setup_test()
self.libraries_svr4_has_correct_load_addr()
- @llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
@expectedFailureNetBSD
def test_libraries_svr4_libs_present(self):
-
import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-
supported_linux_archs = ["x86_64", "i386"]
-supported_oses = ["linux", "windows"]
+supported_oses = ["linux", "windows"]+lldbplatformutil.getDarwinOSTriples()
class TestGdbRemoteMemoryAllocation(gdbremote_testcase.GdbRemoteTestCaseBase):
@skipIf(oslist=no_match(supported_oses))
@skipIf(oslist=["linux"], archs=no_match(supported_linux_archs))
@expectedFailureAll(oslist=["windows"]) # Memory allocated with incorrect permissions
- @llgs_test
def test_supported(self):
"""Make sure (de)allocation works on platforms where it's supposed to
work"""
@skipIf(oslist=["linux"], archs=supported_linux_archs)
@skipIf(oslist=supported_oses)
- @llgs_test
def test_unsupported(self):
"""Make sure we get an "unsupported" error on platforms where the
feature is not implemented."""
True)
self.expect_gdbremote_sequence()
- @llgs_test
def test_bad_packet(self):
"""Make sure we get a proper error for malformed packets."""
-
-
import gdbremote_testcase
import textwrap
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-
def _extract_register_value(reg_info, reg_bank, byte_order, bytes_per_entry=8):
reg_offset = int(reg_info["offset"])*2
reg_byte_size = int(2 * int(reg_info["bitsize"]) / 8)
mydir = TestBase.compute_mydir(__file__)
- def run_test_g_packet(self):
+ @skipIfOutOfTreeDebugserver
+ @skipUnlessDarwin # G packet not supported
+ def test_g_packet(self):
self.build()
self.prep_debug_monitor_and_inferior()
self.test_sequence.add_log_lines(
context = self.expect_gdbremote_sequence()
self.assertNotEqual(context.get("G_reply")[0], 'E')
- @skipIfOutOfTreeDebugserver
- @debugserver_test
- def test_g_packet_debugserver(self):
- self.run_test_g_packet()
-
@skipIf(archs=no_match(["x86_64"]))
def g_returns_correct_data(self, with_suffix):
procs = self.prep_debug_monitor_and_inferior()
@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48420")
@expectedFailureNetBSD
- @llgs_test
- def test_g_returns_correct_data_with_suffix_llgs(self):
+ def test_g_returns_correct_data_with_suffix(self):
self.build()
self.set_inferior_startup_launch()
self.g_returns_correct_data(True)
@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48420")
@expectedFailureNetBSD
- @llgs_test
- def test_g_returns_correct_data_no_suffix_llgs(self):
+ def test_g_returns_correct_data_no_suffix(self):
self.build()
self.set_inferior_startup_launch()
self.g_returns_correct_data(False)
-
import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-
class TestGdbRemoteThreadName(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
self.assertEqual(expected_name, kv_dict.get("name"))
@skipIfWindows # the test is not updated for Windows.
- @llgs_test
def test(self):
""" Make sure lldb-server can retrieve inferior thread name"""
self.build()