forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
c490c5e81a
commit
eb7d32e46f
|
@ -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
|
||||
|
|
|
@ -3,7 +3,6 @@ Test process list.
|
|||
"""
|
||||
|
||||
|
||||
|
||||
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 @@ class ProcessListTestCase(TestBase):
|
|||
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
|
||||
# different during replay.
|
||||
if configuration.is_reproducer_replay():
|
||||
substrs.pop(0)
|
||||
|
||||
self.expect("platform process list -v", substrs=substrs)
|
||||
|
|
Loading…
Reference in New Issue