From 419b4711961216b9c09d06735bb4d442a213fe57 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Wed, 10 Nov 2021 19:12:32 +0000 Subject: [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 --- .../functionalities/scripted_process/TestScriptedProcess.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py') 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)) -- cgit v1.2.3