summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python')
-rw-r--r--lldb/packages/Python/lldbsuite/test/decorators.py11
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py10
2 files changed, 21 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 913779ae66f..1fdfd2caac0 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -783,6 +783,17 @@ def skipIfXmlSupportMissing(func):
have_xml = xml.GetValueForKey("value").GetBooleanValue(fail_value)
return unittest2.skipIf(not have_xml, "requires xml support")(func)
+def skipIfLLVMTargetMissing(target):
+ config = lldb.SBDebugger.GetBuildConfiguration()
+ targets = config.GetValueForKey("targets").GetValueForKey("value")
+ found = False
+ for i in range(targets.GetSize()):
+ if targets.GetItemAtIndex(i).GetStringValue(99) == target:
+ found = True
+ break
+
+ return unittest2.skipIf(not found, "requires " + target)
+
# Call sysctl on darwin to see if a specified hardware feature is available on this machine.
def skipUnlessFeature(feature):
def is_feature_enabled(self):
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
index 022e0483995..879f1adebc6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
@@ -42,23 +42,27 @@ class LinuxCoreTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_i386(self):
"""Test that lldb can read the process information from an i386 linux core file."""
self.do_test("linux-i386", self._i386_pid, self._i386_regions, "a.out")
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
+ @skipIfLLVMTargetMissing("Mips")
def test_mips_o32(self):
"""Test that lldb can read the process information from an MIPS O32 linux core file."""
self.do_test("linux-mipsel-gnuabio32", self._mips_o32_pid,
self._mips_regions, "linux-mipsel-gn")
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
+ @skipIfLLVMTargetMissing("Mips")
def test_mips_n32(self):
"""Test that lldb can read the process information from an MIPS N32 linux core file """
self.do_test("linux-mips64el-gnuabin32", self._mips64_n32_pid,
self._mips_regions, "linux-mips64el-")
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
+ @skipIfLLVMTargetMissing("Mips")
def test_mips_n64(self):
"""Test that lldb can read the process information from an MIPS N64 linux core file """
self.do_test("linux-mips64el-gnuabi64", self._mips64_n64_pid,
@@ -66,6 +70,7 @@ class LinuxCoreTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("PowerPC")
def test_ppc64le(self):
"""Test that lldb can read the process information from an ppc64le linux core file."""
self.do_test("linux-ppc64le", self._ppc64le_pid, self._ppc64le_regions,
@@ -73,6 +78,7 @@ class LinuxCoreTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_x86_64(self):
"""Test that lldb can read the process information from an x86_64 linux core file."""
self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions,
@@ -80,6 +86,7 @@ class LinuxCoreTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("SystemZ")
def test_s390x(self):
"""Test that lldb can read the process information from an s390x linux core file."""
self.do_test("linux-s390x", self._s390x_pid, self._s390x_regions,
@@ -87,6 +94,7 @@ class LinuxCoreTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_same_pid_running(self):
"""Test that we read the information from the core correctly even if we have a running
process with the same PID around"""
@@ -115,6 +123,7 @@ class LinuxCoreTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_two_cores_same_pid(self):
"""Test that we handle the situation if we have two core files with the same PID
around"""
@@ -145,6 +154,7 @@ class LinuxCoreTestCase(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_FPR_SSE(self):
# check x86_64 core file
target = self.dbg.CreateTarget(None)
OpenPOWER on IntegriCloud