Index: utils/lit/lit/formats/googletest.py =================================================================== --- utils/lit/lit/formats/googletest.py +++ utils/lit/lit/formats/googletest.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import os import sys +from subprocess import CalledProcessError import lit.Test import lit.TestRunner @@ -34,6 +35,9 @@ if kIsWindows: lines = lines.replace('\r', '') lines = lines.split('\n') + except CalledProcessError as exception: + litConfig.error(exception.output) + raise StopIteration except: litConfig.error("unable to discover google-tests in %r" % path) raise StopIteration Index: utils/lit/lit/util.py =================================================================== --- utils/lit/lit/util.py +++ utils/lit/lit/util.py @@ -66,9 +66,7 @@ def capture(args, env=None): """capture(command) - Run the given command (or argv list) in a shell and return the standard output.""" - p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - env=env) - out,_ = p.communicate() + out = subprocess.check_output(args, env=env, stderr=subprocess.STDOUT) return convert_string(out) def which(command, paths = None):