Files
clang-p2996/lldb/test/API/python_api/sbplatform/TestSBPlatform.py
Tatyana Krasnukha 05d7d6949c [lldb/tests] Removed add_test_categories decorator for python API tests, NFC
There is a .categories file in the python_api directory that makes all nested tests
belong to the category "pyapi". The decorator is unnecessary for these tests.
2021-02-08 15:10:48 +03:00

23 lines
759 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
@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())