Skip to content

Commit

Permalink
Changing pid message for xctest with --wait-for-debugger flag
Browse files Browse the repository at this point in the history
Summary:
Return json instead of `lldb -p 12345` message.
It should facilitate the parsing of the pid message.

Reviewed By: jbardini

Differential Revision: D32668646

fbshipit-source-id: aa58af39244c80c54722b2b66d218e26ba8b11c6
  • Loading branch information
Ruijie Chen authored and facebook-github-bot committed Jan 4, 2022
1 parent 43a3ecc commit 40f05a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions idb/grpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import logging
import os
import shutil
import sys
import tempfile
import urllib.parse
from asyncio import StreamWriter, StreamReader
Expand All @@ -33,6 +34,7 @@
from grpclib.exceptions import GRPCError, ProtocolError, StreamTerminatedError
from idb.common.constants import TESTS_POLL_INTERVAL
from idb.common.file import drain_to_file
from idb.common.format import json_format_debugger_info
from idb.common.gzip import drain_gzip_decompress, gunzip
from idb.common.hid import (
button_press_to_events,
Expand Down Expand Up @@ -76,6 +78,7 @@
TCPAddress,
TestRunInfo,
VideoFormat,
DebuggerInfo,
)
from idb.grpc.crash import (
_to_crash_log,
Expand Down Expand Up @@ -1176,8 +1179,11 @@ async def run_xctest(
)

if wait_for_debugger and response.debugger.pid:
print("Tests waiting for debugger. To debug run:")
print(f"lldb -p {response.debugger.pid}")
sys.stdout.buffer.write(
json_format_debugger_info(response.debugger).encode()
)
sys.stdout.buffer.write(os.linesep.encode())
sys.stdout.buffer.flush()

for result in make_results(response, log_parser):
if activities_output_path:
Expand Down

0 comments on commit 40f05a2

Please sign in to comment.