Files
clang-p2996/lldb/test/API/python_api/sbplatform/TestSBPlatform.py
Jonas Devlieghere ba3d84d82b [lldb/Test] Skip tests that try to get the remote environment
We don't support getting the remote environment. The gdb remote protocol
has no packet for that.
2020-08-04 14:01:57 -07:00

24 lines
795 B
Python

"""Test the SBPlatform APIs."""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
class SBPlatformAPICase(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(['pyapi'])
@skipIfRemote # Remote environment not supported.
def test_run(self):
self.build()
plat = lldb.SBPlatform.GetHostPlatform()
os.environ["MY_TEST_ENV_VAR"]="SBPlatformAPICase.test_run"
def cleanup():
del os.environ["MY_TEST_ENV_VAR"]
self.addTearDownHook(cleanup)
cmd = lldb.SBPlatformShellCommand(self.getBuildArtifact("a.out"))
self.assertTrue(plat.Run(cmd).Success())
self.assertIn("MY_TEST_ENV_VAR=SBPlatformAPICase.test_run", cmd.GetOutput())