OSDN Git Service

Ensure that both stderr and stdout are captured
authorAlex Light <allight@google.com>
Wed, 8 Feb 2017 18:45:12 +0000 (10:45 -0800)
committerAlex Light <allight@google.com>
Wed, 8 Feb 2017 18:45:12 +0000 (10:45 -0800)
We were not capturing the stdout FD for the run-test process. This was
leading to blank lines being printed during the running of some tests.

Test: ./test/testrunner/testrunner.py --host -j40
Change-Id: I1fb50fb6ae2af9c439f126c9fe47a3e24ad84e10

test/testrunner/testrunner.py

index fd3ebd1..00cb497 100755 (executable)
@@ -452,8 +452,8 @@ def run_test(command, test, test_variant, test_name):
     test_skipped = True
   else:
     test_skipped = False
-    proc = subprocess.Popen(command.split(), stderr=subprocess.PIPE)
-    script_output = proc.stderr.read().strip()
+    proc = subprocess.Popen(command.split(), stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
+    script_output = proc.stdout.read().strip()
     test_passed = not proc.wait()
 
   # If verbose is set to True, every test information is printed on a new line.