1"""Test the SBPlatform APIs.""" 2 3from lldbsuite.test.decorators import * 4from lldbsuite.test.lldbtest import * 5 6class SBPlatformAPICase(TestBase): 7 8 mydir = TestBase.compute_mydir(__file__) 9 NO_DEBUG_INFO_TESTCASE = True 10 11 @add_test_categories(['pyapi']) 12 @skipIfRemote # Remote environment not supported. 13 def test_run(self): 14 self.build() 15 plat = lldb.SBPlatform.GetHostPlatform() 16 17 os.environ["MY_TEST_ENV_VAR"]="SBPlatformAPICase.test_run" 18 def cleanup(): 19 del os.environ["MY_TEST_ENV_VAR"] 20 self.addTearDownHook(cleanup) 21 cmd = lldb.SBPlatformShellCommand(self.getBuildArtifact("a.out")) 22 self.assertTrue(plat.Run(cmd).Success()) 23 self.assertIn("MY_TEST_ENV_VAR=SBPlatformAPICase.test_run", cmd.GetOutput()) 24