Skip to content

Commit ff790af

Browse files
committed
[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 <[email protected]>
1 parent 11ab69d commit ff790af

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ def test_scripted_process_and_scripted_thread(self):
5151
target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
5252
self.assertTrue(target, VALID_TARGET)
5353

54-
scripted_process_example_relpath = 'dummy_scripted_process.py'
5554
os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1'
55+
def cleanup():
56+
del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]
57+
self.addTearDownHook(cleanup)
58+
59+
scripted_process_example_relpath = 'dummy_scripted_process.py'
5660
self.runCmd("command script import " + os.path.join(self.getSourceDir(),
5761
scripted_process_example_relpath))
5862

@@ -98,6 +102,7 @@ def create_stack_skinny_corefile(self, file):
98102
self.assertTrue(self.dbg.DeleteTarget(target), "Couldn't delete target")
99103

100104
@skipUnlessDarwin
105+
@skipIfOutOfTreeDebugserver
101106
@skipIf(archs=no_match(['x86_64']))
102107
def test_launch_scripted_process_stack_frames(self):
103108
"""Test that we can launch an lldb scripted process from the command
@@ -115,8 +120,12 @@ def test_launch_scripted_process_stack_frames(self):
115120
error = target.SetModuleLoadAddress(main_module, 0)
116121
self.assertTrue(error.Success(), "Reloading main module at offset 0 failed.")
117122

118-
scripted_process_example_relpath = 'stack_core_scripted_process.py'
119123
os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1'
124+
def cleanup():
125+
del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]
126+
self.addTearDownHook(cleanup)
127+
128+
scripted_process_example_relpath = 'stack_core_scripted_process.py'
120129
self.runCmd("command script import " + os.path.join(self.getSourceDir(),
121130
scripted_process_example_relpath))
122131

0 commit comments

Comments
 (0)