Skip this test is the test suite is running in a mode where it has no WindowServer access

llvm-svn: 251559
This commit is contained in:
Enrico Granata 2015-10-28 22:08:09 +00:00
parent c88f5d3c2c
commit 9685074fd3
1 changed files with 9 additions and 6 deletions

View File

@ -37,9 +37,12 @@ class Rdar12408181TestCase(TestBase):
lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
window = self.frame().FindVariable("window")
window_dynamic = window.GetDynamicValue(lldb.eDynamicCanRunTarget)
self.assertTrue(window.GetNumChildren() > 1, "NSWindow (static) only has 1 child!")
self.assertTrue(window_dynamic.GetNumChildren() > 1, "NSWindow (dynamic) only has 1 child!")
self.assertTrue(window.GetChildAtIndex(0).IsValid(), "NSWindow (static) has an invalid child")
self.assertTrue(window_dynamic.GetChildAtIndex(0).IsValid(), "NSWindow (dynamic) has an invalid child")
if self.frame().EvaluateExpression('(void*)_CGSDefaultConnection()').GetValueAsUnsigned() != 0:
window = self.frame().FindVariable("window")
window_dynamic = window.GetDynamicValue(lldb.eDynamicCanRunTarget)
self.assertTrue(window.GetNumChildren() > 1, "NSWindow (static) only has 1 child!")
self.assertTrue(window_dynamic.GetNumChildren() > 1, "NSWindow (dynamic) only has 1 child!")
self.assertTrue(window.GetChildAtIndex(0).IsValid(), "NSWindow (static) has an invalid child")
self.assertTrue(window_dynamic.GetChildAtIndex(0).IsValid(), "NSWindow (dynamic) has an invalid child")
else:
self.skipTest('no WindowServer connection')