Skip to content

Commit

Permalink
[lldb/Test] Update TestProcessList.py for reproducer replay
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JDevlieghere committed May 8, 2020
1 parent c490c5e commit eb7d32e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions lldb/packages/Python/lldbsuite/test/configuration.py
Expand Up @@ -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
13 changes: 9 additions & 4 deletions lldb/test/API/commands/platform/process/list/TestProcessList.py
Expand Up @@ -3,7 +3,6 @@
"""



import os
import lldb
import shutil
Expand All @@ -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()
Expand All @@ -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
# different during replay.
if configuration.is_reproducer_replay():
substrs.pop(0)

self.expect("platform process list -v", substrs=substrs)

0 comments on commit eb7d32e

Please sign in to comment.