summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2016-09-16 03:07:14 +0000
committerTodd Fiala <todd.fiala@gmail.com>2016-09-16 03:07:14 +0000
commitd15aa24a7e54733602bf0da27f2d644a67877a8c (patch)
treee3ca326a04f9df2d8926d402c2b6eb60c3f137ab /lldb/packages/Python/lldbsuite
parent991c354b01bc17f866f76f188e57efbd72fbd11f (diff)
downloadbcm5719-llvm-d15aa24a7e54733602bf0da27f2d644a67877a8c.tar.gz
bcm5719-llvm-d15aa24a7e54733602bf0da27f2d644a67877a8c.zip
add availability check to DarwinLog event tests
The pexpect-based tests properly checked for the stub reporting DarwinLog support. The event-based ones did not. This is fixed here. Swift CI bots are not currently building debugserver on macOS, so they don't have the DarwinLog support even when they pass the macOS 10.12 check. llvm-svn: 281696
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/darwin_log.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/darwin_log.py b/lldb/packages/Python/lldbsuite/test/darwin_log.py
index c613ea46782..3207ef0bccd 100644
--- a/lldb/packages/Python/lldbsuite/test/darwin_log.py
+++ b/lldb/packages/Python/lldbsuite/test/darwin_log.py
@@ -325,6 +325,11 @@ class DarwinLogEventBasedTestBase(lldbtest.TestBase):
self.runCmd("settings set target.process.extra-startup-command "
"QSetLogging:bitmask=LOG_DARWIN_LOG;")
+ def darwin_log_available(self):
+ match = self.match("plugin structured-data darwin-log status",
+ patterns=[r"Availability: ([\S]+)"])
+ return match is not None and (match.group(1) == "available")
+
def do_test(self, enable_options, settings_commands=None,
run_enable_after_breakpoint=False, max_entry_count=None):
"""Runs the test inferior, returning collected events.
@@ -401,6 +406,14 @@ class DarwinLogEventBasedTestBase(lldbtest.TestBase):
# And our one and only breakpoint should have been hit.
self.assertEquals(breakpoint.GetHitCount(), 1)
+ # Check if DarwinLog is available. This check cannot be done
+ # until after the process has started, as the feature availability
+ # comes through the stub. The stub isn't running until
+ # the target process is running. So this is really the earliest
+ # we can check.
+ if not self.darwin_log_available():
+ self.skipTest("DarwinLog not available")
+
# Now setup the structured data listener.
#
# Grab the broadcaster for the process. We'll be attaching our
OpenPOWER on IntegriCloud