googletest formatted tests are discovered by running the test executable.
Previously testing would silently succeed if the test executable crashed
during the discovery process. Now testing fails with "error: unable to
discover google-tests ..." if the test executable exits with a non-zero status.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280455
91177308-0d34-0410-b5e6-
96231b3b80d8
lines = lines.replace('\r', '')
lines = lines.split('\n')
except:
- litConfig.error("unable to discover google-tests in %r" % path)
+ litConfig.error("unable to discover google-tests in %r: %s"
+ % (path, sys.exc_info()[1]))
raise StopIteration
nested_tests = []
def capture(args, env=None):
"""capture(command) - Run the given command (or argv list) in a shell and
- return the standard output."""
+ return the standard output. Raises a CalledProcessError if the command
+ exits with a non-zero status."""
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
env=env)
out,_ = p.communicate()
+ if p.returncode != 0:
+ raise subprocess.CalledProcessError(cmd=args, returncode=p.returncode)
return convert_string(out)
def which(command, paths = None):