[Lldb-commits] [lldb] eb7d32e - [lldb/Test] Update TestProcessList.py for reproducer replay

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri May 8 13:14:26 PDT 2020


Author: Jonas Devlieghere
Date: 2020-05-08T13:14:18-07:00
New Revision: eb7d32e46fe184fdfcb52e0a25973e713047e305

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

LOG: [lldb/Test] Update TestProcessList.py for reproducer replay

Because LLDB isn't the one spawning the subprocess, the PID is different
during replay. Exclude it form the substring check during replay.

Depends on D79646 to pass with reproducer replay.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/configuration.py
    lldb/test/API/commands/platform/process/list/TestProcessList.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index ddae780339cb..53f587b47db8 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -160,3 +160,9 @@ def get_filecheck_path():
     """
     if filecheck and os.path.lexists(filecheck):
         return filecheck
+
+def is_reproducer_replay():
+    """
+    Returns true when test is replayed from a reproducer.
+    """
+    return replay_path is not None

diff  --git a/lldb/test/API/commands/platform/process/list/TestProcessList.py b/lldb/test/API/commands/platform/process/list/TestProcessList.py
index d20f6d6a5fea..ba0193ab1a68 100644
--- a/lldb/test/API/commands/platform/process/list/TestProcessList.py
+++ b/lldb/test/API/commands/platform/process/list/TestProcessList.py
@@ -3,7 +3,6 @@
 """
 
 
-
 import os
 import lldb
 import shutil
@@ -18,7 +17,7 @@ class ProcessListTestCase(TestBase):
 
     NO_DEBUG_INFO_TESTCASE = True
 
-    @skipIfWindows # https://bugs.llvm.org/show_bug.cgi?id=43702
+    @skipIfWindows  # https://bugs.llvm.org/show_bug.cgi?id=43702
     def test_process_list_with_args(self):
         """Test process list show process args"""
         self.build()
@@ -28,5 +27,11 @@ def test_process_list_with_args(self):
         popen = self.spawnSubprocess(exe, args=["arg1", "--arg2", "arg3"])
         self.addTearDownHook(self.cleanupSubprocesses)
 
-        self.expect("platform process list -v",
-                    substrs=[str(popen.pid), "TestProcess arg1 --arg2 arg3"])
+        substrs = [str(popen.pid), "TestProcess arg1 --arg2 arg3"]
+
+        # Because LLDB isn't the one spawning the subprocess, the PID will be
+        # 
diff erent during replay.
+        if configuration.is_reproducer_replay():
+            substrs.pop(0)
+
+        self.expect("platform process list -v", substrs=substrs)


        


More information about the lldb-commits mailing list