[Lldb-commits] [lldb] 419b471 - [lldb/test] Skip TestScriptedProcess when using system's debugserver (NFC)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 10 11:12:53 PST 2021


Author: Med Ismail Bennani
Date: 2021-11-10T20:12:42+01:00
New Revision: 419b4711961216b9c09d06735bb4d442a213fe57

URL: https://github.com/llvm/llvm-project/commit/419b4711961216b9c09d06735bb4d442a213fe57
DIFF: https://github.com/llvm/llvm-project/commit/419b4711961216b9c09d06735bb4d442a213fe57.diff

LOG: [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 at gmail.com>

Added: 
    

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

Removed: 
    


################################################################################
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 @@ def test_scripted_process_and_scripted_thread(self):
         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 @@ def create_stack_skinny_corefile(self, file):
         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 @@ def test_launch_scripted_process_stack_frames(self):
         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))
 


        


More information about the lldb-commits mailing list