From f1389e92015ae8c5df0579fbf7685f69f4c28955 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 19 Feb 2018 15:06:28 +0000 Subject: Add SBDebugger::GetBuildConfiguration and use it to skip an XML test Summary: This adds a SBDebugger::GetBuildConfiguration static function, which returns a SBStructuredData describing the the build parameters of liblldb. Right now, it just contains one entry: whether we were built with XML support. I use the new functionality to skip a test which requires XML support, but concievably the new function could be useful to other liblldb clients as well (making sure the library supports the feature they are about to use). Reviewers: zturner, jingham, clayborg, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43333 llvm-svn: 325504 --- lldb/packages/Python/lldbsuite/test/decorators.py | 8 ++++++++ .../test/functionalities/gdb_remote_client/TestTargetXMLArch.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'lldb/packages/Python/lldbsuite/test') diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index f0afa9aea84..c6e5815360a 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -763,3 +763,11 @@ def skipUnlessAddressSanitizer(func): return "Compiler cannot compile with -fsanitize=address" return None return skipTestIfFn(is_compiler_with_address_sanitizer)(func) + +def skipIfXmlSupportMissing(func): + config = lldb.SBDebugger.GetBuildConfiguration() + xml = config.GetValueForKey("xml") + + fail_value = True # More likely to notice if something goes wrong + have_xml = xml.GetValueForKey("value").GetBooleanValue(fail_value) + return unittest2.skipIf(not have_xml, "requires xml support")(func) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py b/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py index b12b8f1356a..b6d38955807 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py @@ -6,7 +6,7 @@ from gdbclientutils import * class TestTargetXMLArch(GDBRemoteTestBase): - @skipIf(hostoslist=no_match(lldbplatformutil.getDarwinOSTriples())) + @skipIfXmlSupportMissing @expectedFailureAll(archs=["i386"]) @skipIfRemote def test(self): -- cgit v1.2.3