Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions lldb/packages/Python/lldbsuite/test/lldbutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,6 @@ def launch_exe_in_apple_simulator(
device_uuid,
exe_path,
exe_args=[],
stderr_lines_to_read=0,
stderr_patterns=[],
log=None,
):
Expand All @@ -1907,19 +1906,22 @@ def launch_exe_in_apple_simulator(
total_patterns = len(stderr_patterns)
matches_found = 0
matched_strings = [None] * total_patterns
for _ in range(0, stderr_lines_to_read):
stderr = sim_launcher.stderr.readline().decode("utf-8")
if not stderr:
continue
for i, pattern in enumerate(stderr_patterns):
if matched_strings[i] is not None:
if len(stderr_patterns) != 0:
while True:
stderr = sim_launcher.stderr.readline().decode("utf-8")
if not stderr:
continue
match = re.match(pattern, stderr)
if match:
matched_strings[i] = str(match.group(1))
matches_found += 1
if matches_found == total_patterns:
break
if log:
log(f"searching stderr line: {stderr}")
for i, pattern in enumerate(stderr_patterns):
if matched_strings[i] is not None:
continue
match = re.match(pattern, stderr)
if match:
matched_strings[i] = str(match.group(1))
matches_found += 1
if matches_found == total_patterns:
break

return exe_path, matched_strings

Expand Down
1 change: 0 additions & 1 deletion lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def run_with(
device_udid,
self.getBuildArtifact("a.out"),
exe_args=[],
stderr_lines_to_read=1, # in hello.cpp, the pid is printed first
stderr_patterns=[r"PID: (.*)"],
log=self.trace,
)
Expand Down
3 changes: 0 additions & 3 deletions lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@


class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase):
# Number of stderr lines to read from the simctl output.
READ_LINES = 10

def check_simulator_ostype(self, sdk, platform_name, arch=platform.machine()):
# Get simulator
Expand Down Expand Up @@ -56,7 +54,6 @@ def check_simulator_ostype(self, sdk, platform_name, arch=platform.machine()):
deviceUDID,
self.getBuildArtifact(exe_name),
["print-pid", "sleep:10"],
self.READ_LINES,
[r"PID: (.*)"],
self.trace,
)
Expand Down