Commit c9c762dc authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

testsuite: Pipe stdin directly to process

Previously the driver would read the stdin content from the source file
and then write it to the subprocess' stdin. We now simply open the stdin
file and provide that handle to the subprocess as its stdin

Test Plan: Validate

Reviewers: austin

Subscribers: rwbarton, thomie, goldfire

Differential Revision:
parent 8e51bfc3
......@@ -1792,15 +1792,7 @@ def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, pr
# declare the buffers to a default
stdin_buffer = None
# ***** IMPORTANT *****
# We have to treat input and output as
# just binary data here. Don't try to decode
# it to a string, since we have tests that actually
# feed malformed utf-8 to see how GHC handles it.
if stdin:
with, 'rb') as f:
stdin_buffer =
stdin_file =, 'rb') if stdin else None
stdout_buffer = b''
stderr_buffer = b''
......@@ -1815,12 +1807,14 @@ def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, pr
# to invoke the Bourne shell
r = subprocess.Popen([timeout_prog, timeout, cmd],
stdout_buffer, stderr_buffer = r.communicate(stdin_buffer)
stdout_buffer, stderr_buffer = r.communicate()
if stdin_file:
if config.verbose >= 1 and print_output >= 1:
if stdout_buffer:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment