summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2021-11-10 19:12:32 +0000
committerMed Ismail Bennani <medismail.bennani@gmail.com>2021-11-10 20:12:42 +0100
commit419b4711961216b9c09d06735bb4d442a213fe57 (patch)
treeb6b88163ba692a570eea8eae3c62ef144ca3c2dc /lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
parentc6258a20ef418ea8b636ecafa910c2ae28cbdd9d (diff)
[lldb/test] Skip TestScriptedProcess when using system's debugserver (NFC)
Because TestScriptedProcess.py creates a skinny corefile to provides data to the ScriptedProcess and ScriptedThread, we need to make sure that the debugserver used is not out of tree, to ensure feature availability between debugserver and lldb. This also removes the `SKIP_SCRIPTED_PROCESS_LAUNCH` env variable after each test finish running. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py')
-rw-r--r--lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py b/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
index b8319d722e34..342068328310 100644
--- a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
+++ b/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
@@ -51,8 +51,12 @@ class ScriptedProcesTestCase(TestBase):
target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
- scripted_process_example_relpath = 'dummy_scripted_process.py'
os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1'
+ def cleanup():
+ del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]
+ self.addTearDownHook(cleanup)
+
+ scripted_process_example_relpath = 'dummy_scripted_process.py'
self.runCmd("command script import " + os.path.join(self.getSourceDir(),
scripted_process_example_relpath))
@@ -98,6 +102,7 @@ class ScriptedProcesTestCase(TestBase):
self.assertTrue(self.dbg.DeleteTarget(target), "Couldn't delete target")
@skipUnlessDarwin
+ @skipIfOutOfTreeDebugserver
@skipIf(archs=no_match(['x86_64']))
def test_launch_scripted_process_stack_frames(self):
"""Test that we can launch an lldb scripted process from the command
@@ -115,8 +120,12 @@ class ScriptedProcesTestCase(TestBase):
error = target.SetModuleLoadAddress(main_module, 0)
self.assertTrue(error.Success(), "Reloading main module at offset 0 failed.")
- scripted_process_example_relpath = 'stack_core_scripted_process.py'
os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1'
+ def cleanup():
+ del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]
+ self.addTearDownHook(cleanup)
+
+ scripted_process_example_relpath = 'stack_core_scripted_process.py'
self.runCmd("command script import " + os.path.join(self.getSourceDir(),
scripted_process_example_relpath))