[TestMTCSimple] Disable the test if you don't have libMTC
authorAlex Langford <apl@fb.com>
Tue, 5 Nov 2019 22:11:24 +0000 (14:11 -0800)
committerAlex Langford <apl@fb.com>
Tue, 5 Nov 2019 22:11:26 +0000 (14:11 -0800)
If you are running on macOS and have the CommandLineTools installed of
Xcode, this test will fail because CommandLineTools doesn't ship with
libMainThreadChecker. Skip the test if you don't have it installed.

lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py

index e530c47d2d39b4779af38b79e4f7bafc61b9974b..e3751e02c45fbc7107e77fd5ffb75d057b450c05 100644 (file)
@@ -17,12 +17,16 @@ class MTCSimpleTestCase(TestBase):
     @skipUnlessDarwin
     def test(self):
         self.mtc_dylib_path = findMainThreadCheckerDylib()
-        self.assertTrue(self.mtc_dylib_path != "")
+        if self.mtc_dylib_path == "":
+            self.skipTest("This test requires libMainThreadChecker.dylib")
+
         self.build()
         self.mtc_tests()
 
     @skipIf(archs=['i386'])
     def mtc_tests(self):
+        self.assertTrue(self.mtc_dylib_path != "")
+
         # Load the test
         exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe, patterns=["Current executable set to .*a.out"])