From 80b080723ff7f8a0097d76a322b241514a7f3864 Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Wed, 9 Oct 2019 23:52:31 +0000 Subject: TestMTCSimple.py: allow the test to run on Darwin embedded platforms The test needed some updates to run using a different UI toolkit and with a different libMTC, but it should run fine on a device. llvm-svn: 374262 --- .../functionalities/mtc/simple/TestMTCSimple.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py b/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py index 0b4c0d1e0fa..e530c47d2d3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py @@ -15,19 +15,12 @@ class MTCSimpleTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin - @skipIfDarwinEmbedded # Test file depends on AppKit which is not present on iOS etc. def test(self): self.mtc_dylib_path = findMainThreadCheckerDylib() - if self.mtc_dylib_path == "": - self.skipTest("This test requires libMainThreadChecker.dylib.") - + self.assertTrue(self.mtc_dylib_path != "") self.build() self.mtc_tests() - def setUp(self): - # Call super's setUp(). - TestBase.setUp(self) - @skipIf(archs=['i386']) def mtc_tests(self): # Load the test @@ -41,7 +34,11 @@ class MTCSimpleTestCase(TestBase): thread = process.GetSelectedThread() frame = thread.GetSelectedFrame() - self.expect("thread info", substrs=['stop reason = -[NSView superview] must be used from main thread only']) + view = "NSView" if lldbplatformutil.getPlatform() == "macosx" else "UIView" + + self.expect("thread info", + substrs=['stop reason = -[' + view + + ' superview] must be used from main thread only']) self.expect( "thread info -s", @@ -51,7 +48,7 @@ class MTCSimpleTestCase(TestBase): json_line = '\n'.join(output_lines[2:]) data = json.loads(json_line) self.assertEqual(data["instrumentation_class"], "MainThreadChecker") - self.assertEqual(data["api_name"], "-[NSView superview]") - self.assertEqual(data["class_name"], "NSView") + self.assertEqual(data["api_name"], "-[" + view + " superview]") + self.assertEqual(data["class_name"], view) self.assertEqual(data["selector"], "superview") - self.assertEqual(data["description"], "-[NSView superview] must be used from main thread only") + self.assertEqual(data["description"], "-[" + view + " superview] must be used from main thread only") -- cgit v1.2.3