diff options
author | Pavel Labath <labath@google.com> | 2018-02-19 15:06:28 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-02-19 15:06:28 +0000 |
commit | f1389e92015ae8c5df0579fbf7685f69f4c28955 (patch) | |
tree | 426e1aca9b5015cd9102512d6d8ed3b353a7c87e /lldb/packages/Python/lldbsuite/test | |
parent | 07ea77e3bc728dda6faf1feb5592d4958232f6a5 (diff) | |
download | bcm5719-llvm-f1389e92015ae8c5df0579fbf7685f69f4c28955.tar.gz bcm5719-llvm-f1389e92015ae8c5df0579fbf7685f69f4c28955.zip |
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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/decorators.py | 8 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py | 2 |
2 files changed, 9 insertions, 1 deletions
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): |