Skip to content

Commit eb7d32e

Browse files
committed
[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.
1 parent c490c5e commit eb7d32e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

lldb/packages/Python/lldbsuite/test/configuration.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,9 @@ def get_filecheck_path():
160160
"""
161161
if filecheck and os.path.lexists(filecheck):
162162
return filecheck
163+
164+
def is_reproducer_replay():
165+
"""
166+
Returns true when test is replayed from a reproducer.
167+
"""
168+
return replay_path is not None

lldb/test/API/commands/platform/process/list/TestProcessList.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55

6-
76
import os
87
import lldb
98
import shutil
@@ -18,7 +17,7 @@ class ProcessListTestCase(TestBase):
1817

1918
NO_DEBUG_INFO_TESTCASE = True
2019

21-
@skipIfWindows # https://bugs.llvm.org/show_bug.cgi?id=43702
20+
@skipIfWindows # https://bugs.llvm.org/show_bug.cgi?id=43702
2221
def test_process_list_with_args(self):
2322
"""Test process list show process args"""
2423
self.build()
@@ -28,5 +27,11 @@ def test_process_list_with_args(self):
2827
popen = self.spawnSubprocess(exe, args=["arg1", "--arg2", "arg3"])
2928
self.addTearDownHook(self.cleanupSubprocesses)
3029

31-
self.expect("platform process list -v",
32-
substrs=[str(popen.pid), "TestProcess arg1 --arg2 arg3"])
30+
substrs = [str(popen.pid), "TestProcess arg1 --arg2 arg3"]
31+
32+
# Because LLDB isn't the one spawning the subprocess, the PID will be
33+
# different during replay.
34+
if configuration.is_reproducer_replay():
35+
substrs.pop(0)
36+
37+
self.expect("platform process list -v", substrs=substrs)

0 commit comments

Comments
 (0)