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    def test_run(self):
13        self.build()
14        plat = lldb.SBPlatform.GetHostPlatform()
15
16        os.environ["MY_TEST_ENV_VAR"]="SBPlatformAPICase.test_run"
17        def cleanup():
18            del os.environ["MY_TEST_ENV_VAR"]
19        self.addTearDownHook(cleanup)
20        cmd = lldb.SBPlatformShellCommand(self.getBuildArtifact("a.out"))
21        self.assertTrue(plat.Run(cmd).Success())
22        self.assertIn("MY_TEST_ENV_VAR=SBPlatformAPICase.test_run", cmd.GetOutput())
23